|
QGIS API Documentation
master-6164ace
|
Object representing map window. More...
#include <qgscomposermap.h>
Inheritance diagram for QgsComposerMap:
Collaboration diagram for QgsComposerMap:Public Types | |
| enum | Border { Left, Right, Bottom, Top } |
| Enum for different frame borders. More... | |
| enum | GridAnnotationDirection { Horizontal = 0, Vertical, HorizontalAndVertical, BoundaryDirection } |
| enum | GridAnnotationFormat { Decimal = 0, DegreeMinute, DegreeMinuteSecond } |
| enum | GridAnnotationPosition { InsideMapFrame = 0, OutsideMapFrame, Disabled } |
| enum | GridFrameStyle { NoGridFrame = 0, Zebra } |
| enum | GridStyle { Solid = 0, Cross } |
| enum | PreviewMode { Cache = 0, Render, Rectangle } |
| Preview style. More... | |
Public Slots | |
| void | renderModeUpdateCachedImage () |
| Call updateCachedImage if item is in render mode. | |
| void | updateCachedImage () |
| Called if map canvas has changed. | |
Signals | |
| void | extentChanged () |
Public Member Functions | |
| QgsComposerMap (QgsComposition *composition, int x, int y, int width, int height) | |
| Constructor. | |
| QgsComposerMap (QgsComposition *composition) | |
| Constructor. | |
| virtual | ~QgsComposerMap () |
| QColor | annotationFontColor () const |
| Get font color for grid annotations. | |
| double | annotationFrameDistance () const |
| void | assignFreeId () |
| Sets mId to a number not yet used in the composition. | |
| QRectF | boundingRect () const |
| In case of annotations, the bounding rectangle can be larger than the map item rectangle. | |
| void | cache () |
| Create cache image. | |
| bool | containsAdvancedEffects () const |
| True if composer map contains layers with blend modes or flattened layers for vectors. | |
| bool | containsWMSLayer () const |
| True if composer map renders a WMS layer. | |
| double | crossLength () |
| void | draw (QPainter *painter, const QgsRectangle &extent, const QSizeF &size, double dpi, double *forceWidthScale=0) |
| Draw to paint device. | |
| bool | drawCanvasItems () const |
| QgsRectangle | extent () const |
| GridAnnotationDirection | gridAnnotationDirection (QgsComposerMap::Border border) const |
| QFont | gridAnnotationFont () const |
| GridAnnotationFormat | gridAnnotationFormat () const |
| GridAnnotationPosition | gridAnnotationPosition (QgsComposerMap::Border border) const |
| int | gridAnnotationPrecision () const |
| QPainter::CompositionMode | gridBlendMode () const |
| Returns the grid's blending mode. | |
| bool | gridEnabled () const |
| GridFrameStyle | gridFrameStyle () const |
| double | gridFrameWidth () const |
| double | gridIntervalX () const |
| double | gridIntervalY () const |
| QgsLineSymbolV2 * | gridLineSymbol () |
| double | gridOffsetX () const |
| double | gridOffsetY () const |
| QPen | gridPen () const |
| GridStyle | gridStyle () const |
| int | id () const |
| Get identification number. | |
| bool | isDrawing () const |
| True if a draw is already in progress. | |
| bool | keepLayerSet () const |
| Getter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas. | |
| QStringList | layerSet () const |
| Getter for stored layer set that is used if mKeepLayerSet is true. | |
| const QgsMapRenderer * | mapRenderer () const |
| double | mapUnitsToMM () const |
| Returns the conversion factor map units -> mm. | |
| void | moveContent (double dx, double dy) |
| Move content of map. | |
| QPainter::CompositionMode | overviewBlendMode () const |
| Returns the overview's blending mode. | |
| int | overviewFrameMapId () const |
| Returns id of overview frame (or -1 if no overfiew frame) | |
| QgsFillSymbolV2 * | overviewFrameMapSymbol () |
| bool | overviewInverted () const |
| Returns true if the overview frame is inverted. | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) |
| Reimplementation of QCanvasItem::paint - draw on canvas. | |
| PreviewMode | previewMode () const |
| bool | readXML (const QDomElement &itemElem, const QDomDocument &doc) |
| sets state from Dom document | |
| void | resize (double dx, double dy) |
| resizes an item in x- and y direction (canvas coordinates) | |
| double | scale () const |
| Scale. | |
| void | setAnnotationFontColor (const QColor &c) |
| Sets font color for grid annotations. | |
| void | setAnnotationFrameDistance (double d) |
| Sets distance between map frame and annotations. | |
| void | setCacheUpdated (bool u=false) |
| void | setCrossLength (double l) |
| Sets length of the cros segments (if grid style is cross) | |
| void | setDrawCanvasItems (bool b) |
| void | setGridAnnotationDirection (GridAnnotationDirection d, QgsComposerMap::Border border) |
| void | setGridAnnotationFont (const QFont &f) |
| Sets font for grid annotations. | |
| void | setGridAnnotationFormat (GridAnnotationFormat f) |
| void | setGridAnnotationPosition (GridAnnotationPosition p, QgsComposerMap::Border border) |
| void | setGridAnnotationPrecision (int p) |
| Sets coordinate precision for grid annotations. | |
| void | setGridBlendMode (QPainter::CompositionMode blendMode) |
| Sets the grid's blending mode. | |
| void | setGridEnabled (bool enabled) |
| Enables a coordinate grid that is shown on top of this composermap. | |
| void | setGridFrameStyle (GridFrameStyle style) |
| Set grid frame style (NoGridFrame or Zebra) | |
| void | setGridFrameWidth (double w) |
| Set grid frame width. | |
| void | setGridIntervalX (double interval) |
| Sets coordinate interval in x-direction for composergrid. | |
| void | setGridIntervalY (double interval) |
| Sets coordinate interval in y-direction for composergrid. | |
| void | setGridLineSymbol (QgsLineSymbolV2 *symbol) |
| void | setGridOffsetX (double offset) |
| Sets x-coordinate offset for composer grid. | |
| void | setGridOffsetY (double offset) |
| Sets y-coordinate offset for composer grid. | |
| void | setGridPen (const QPen &p) |
| Sets the pen to draw composer grid. | |
| void | setGridPenColor (const QColor &c) |
| Sets the color of the grid pen. | |
| void | setGridPenWidth (double w) |
| Sets with of grid pen. | |
| void | setGridStyle (GridStyle style) |
| Sets coordinate grid style to solid or cross. | |
| void | setKeepLayerSet (bool enabled) |
| Setter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas. | |
| void | setLayerSet (const QStringList &layerSet) |
| Setter for stored layer set that is used if mKeepLayerSet is true. | |
| void | setMapCanvas (QGraphicsView *canvas) |
| Sets canvas pointer (necessary to query and draw map canvas items) | |
| void | setMapRotation (double r) |
| void | setNewExtent (const QgsRectangle &extent) |
| Sets new Extent and changes width, height (and implicitely also scale) | |
| void | setNewScale (double scaleDenominator) |
| Sets new scale and changes only mExtent. | |
| void | setOffset (double xOffset, double yOffset) |
| Sets offset values to shift image (useful for live updates when moving item content) | |
| void | setOverviewBlendMode (QPainter::CompositionMode blendMode) |
| Sets the overview's blending mode. | |
| void | setOverviewFrameMap (int mapId) |
| Sets overview frame map. | |
| void | setOverviewFrameMapSymbol (QgsFillSymbolV2 *symbol) |
| void | setOverviewInverted (bool inverted) |
| Sets the overview's inversion mode. | |
| void | setPreviewMode (PreviewMode m) |
| void | setSceneRect (const QRectF &rectangle) |
| Sets new scene rectangle bounds and recalculates hight and extent. | |
| void | setShowGridAnnotation (bool show) |
| Sets flag if grid annotation should be shown. | |
| bool | showGridAnnotation () const |
| void | storeCurrentLayerSet () |
| Stores the current layer set of the qgis mapcanvas in mLayerSet. | |
| virtual int | type () const |
| return correct graphics item type. | |
| void | updateBoundingRect () |
| Updates the bounding rect of this item. | |
| void | updateItem () |
| Updates item, with the possibility to do custom update for subclasses. | |
| bool | writeXML (QDomElement &elem, QDomDocument &doc) const |
| stores state in Dom node | |
| void | zoomContent (int delta, double x, double y) |
| Zoom content of map. | |
Private Types | |
| enum | AnnotationCoordinate { Longitude = 0, Latitude } |
Private Member Functions | |
| Border | borderForLineCoord (const QPointF &p) const |
| Returns the item border of a point (in item coordinates) | |
| QPointF | composerMapPosForItem (const QGraphicsItem *item) const |
| void | connectUpdateSlot () |
| Establishes signal/slot connection for update in case of layer change. | |
| void | createDefaultGridLineSymbol () |
| void | createDefaultOverviewFrameSymbol () |
| void | drawAnnotation (QPainter *p, const QPointF &pos, int rotation, const QString &annotationText) |
| Draws a single annotation. | |
| void | drawCanvasItem (QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *itemStyle) |
| void | drawCanvasItems (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle) |
| void | drawCoordinateAnnotation (QPainter *p, const QPointF &pos, QString annotationString) |
| void | drawCoordinateAnnotations (QPainter *p, const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines) |
| Draw coordinates for mGridAnnotationType Coordinate. | |
| void | drawGrid (QPainter *p) |
| Draws the map grid. | |
| void | drawGridFrame (QPainter *p, const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines) |
| void | drawGridFrameBorder (QPainter *p, const QMap< double, double > &borderPos, Border border) |
| void | drawGridLine (const QLineF &line, QPainter *p) |
| void | drawOverviewMapExtent (QPainter *p) |
| QString | gridAnnotationString (double value, AnnotationCoordinate coord) const |
| void | initGridAnnotationFormatFromProject () |
| void | mapPolygon (QPolygonF &poly) const |
| Returns the polygon of the map extent. | |
| QPointF | mapToItemCoords (const QPointF &mapCoords) const |
| Transforms map coordinates to item coordinates (considering rotation and move offset) | |
| double | maxExtension () const |
| void | requestedExtent (QgsRectangle &extent) const |
| Calculates the extent to request and the yShift of the top-left point in case of rotation. | |
| void | sortGridLinesOnBorders (const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines, QMap< double, double > &leftFrameEntries, QMap< double, double > &rightFrameEntries, QMap< double, double > &topFrameEntries, QMap< double, double > &bottomFrameEntries) const |
| void | syncLayerSet () |
| Removes layer ids from mLayerSet that are no longer present in the qgis main map. | |
| QgsRectangle | transformedExtent () const |
| Returns extent that considers mOffsetX / mOffsetY (during content move) | |
| QPolygonF | transformedMapPolygon () const |
| Returns extent that considers rotation and shift with mOffsetX / mOffsetY. | |
| void | transformShift (double &xShift, double &yShift) const |
| Scales a composer map shift (in MM) and rotates it by mRotation. | |
| int | xGridLines (QList< QPair< double, QLineF > > &lines) const |
| Returns the grid lines with associated coordinate value. | |
| int | yGridLines (QList< QPair< double, QLineF > > &lines) const |
| Returns the grid lines for the y-coordinates. | |
Private Attributes | |
| double | mAnnotationFrameDistance |
| Distance between map frame and annotation. | |
| GridAnnotationDirection | mBottomGridAnnotationDirection |
| Annotation direction on bottom side ( horizontal or vertical ) | |
| GridAnnotationPosition | mBottomGridAnnotationPosition |
| Annotation position for bottom map side (inside / outside / not shown) | |
| QImage | mCacheImage |
| bool | mCacheUpdated |
| double | mCrossLength |
| The length of the cross sides for mGridStyle Cross. | |
| QRectF | mCurrentRectangle |
| Current bounding rectangle. | |
| bool | mDrawCanvasItems |
| True if annotation items, rubber band, etc. | |
| bool | mDrawing |
| set to true if in state of drawing. | |
| QgsRectangle | mExtent |
| QFont | mGridAnnotationFont |
| Font for grid line annotation. | |
| QColor | mGridAnnotationFontColor |
| Font color for grid line annotation. | |
| GridAnnotationFormat | mGridAnnotationFormat |
| int | mGridAnnotationPrecision |
| Digits after the dot. | |
| QPainter::CompositionMode | mGridBlendMode |
| Blend mode for grid. | |
| bool | mGridEnabled |
| True if coordinate grid has to be displayed. | |
| GridFrameStyle | mGridFrameStyle |
| double | mGridFrameWidth |
| double | mGridIntervalX |
| Grid line interval in x-direction (map units) | |
| double | mGridIntervalY |
| Grid line interval in y-direction (map units) | |
| QgsLineSymbolV2 * | mGridLineSymbol |
| double | mGridOffsetX |
| Grid line offset in x-direction. | |
| double | mGridOffsetY |
| Grid line offset in y-direction. | |
| GridStyle | mGridStyle |
| Solid or crosses. | |
| int | mId |
| Unique identifier. | |
| bool | mKeepLayerSet |
| Flag if layers to be displayed should be read from qgis canvas (true) or from stored list in mLayerSet (false) | |
| QStringList | mLayerSet |
| Stored layer list (used if layer live-link mKeepLayerSet is disabled) | |
| GridAnnotationDirection | mLeftGridAnnotationDirection |
| Annotation direction on left side ( horizontal or vertical ) | |
| GridAnnotationPosition | mLeftGridAnnotationPosition |
| Annotation position for left map side (inside / outside / not shown) | |
| QGraphicsView * | mMapCanvas |
| QgsMapRenderer * | mMapRenderer |
| int | mNumCachedLayers |
| Number of layers when cache was created. | |
| QPainter::CompositionMode | mOverviewBlendMode |
| Blend mode for overview. | |
| int | mOverviewFrameMapId |
| Id of map which displays its extent rectangle into this composer map (overview map functionality). | |
| QgsFillSymbolV2 * | mOverviewFrameMapSymbol |
| Drawing style for overview farme. | |
| bool | mOverviewInverted |
| PreviewMode | mPreviewMode |
| Preview style. | |
| GridAnnotationDirection | mRightGridAnnotationDirection |
| Annotation direction on right side ( horizontal or vertical ) | |
| GridAnnotationPosition | mRightGridAnnotationPosition |
| Annotation position for right map side (inside / outside / not shown) | |
| bool | mShowGridAnnotation |
| True if coordinate values should be drawn. | |
| GridAnnotationDirection | mTopGridAnnotationDirection |
| Annotation direction on top side ( horizontal or vertical ) | |
| GridAnnotationPosition | mTopGridAnnotationPosition |
| Annotation position for top map side (inside / outside / not shown) | |
| double | mXOffset |
| Offset in x direction for showing map cache image. | |
| double | mYOffset |
| Offset in y direction for showing map cache image. | |
Object representing map window.
Definition at line 42 of file qgscomposermap.h.
enum QgsComposerMap::AnnotationCoordinate [private] |
Definition at line 359 of file qgscomposermap.h.
Enum for different frame borders.
Definition at line 99 of file qgscomposermap.h.
Definition at line 77 of file qgscomposermap.h.
Definition at line 85 of file qgscomposermap.h.
Definition at line 70 of file qgscomposermap.h.
Definition at line 92 of file qgscomposermap.h.
Definition at line 64 of file qgscomposermap.h.
| QgsComposerMap::QgsComposerMap | ( | QgsComposition * | composition, |
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height | ||
| ) |
Constructor.
Definition at line 42 of file qgscomposermap.cpp.
References assignFreeId(), QgsComposerItem::composition(), connectUpdateSlot(), createDefaultGridLineSymbol(), createDefaultOverviewFrameSymbol(), QgsMapRenderer::extent(), initGridAnnotationFormatFromProject(), QgsComposition::mapRenderer(), mCacheUpdated, QgsComposerItem::mComposition, mCurrentRectangle, mDrawing, mExtent, mGridLineSymbol, mId, mMapRenderer, mOverviewFrameMapSymbol, mPreviewMode, mXOffset, mYOffset, Rectangle, setSceneRect(), and tr.
| QgsComposerMap::QgsComposerMap | ( | QgsComposition * | composition | ) |
Constructor.
Settings are read from project.
Definition at line 87 of file qgscomposermap.cpp.
References QgsComposition::composerMapItems(), QgsComposerItem::composition(), connectUpdateSlot(), createDefaultOverviewFrameSymbol(), initGridAnnotationFormatFromProject(), QgsComposition::mapRenderer(), QgsComposerItem::mComposition, mCurrentRectangle, mGridLineSymbol, mId, mMapRenderer, mOverviewFrameMapSymbol, mPreviewMode, mXOffset, mYOffset, Rectangle, and tr.
| QgsComposerMap::~QgsComposerMap | ( | ) | [virtual] |
Definition at line 119 of file qgscomposermap.cpp.
References mGridLineSymbol, and mOverviewFrameMapSymbol.
| QColor QgsComposerMap::annotationFontColor | ( | ) | const [inline] |
Get font color for grid annotations.
Definition at line 254 of file qgscomposermap.h.
| double QgsComposerMap::annotationFrameDistance | ( | ) | const [inline] |
Definition at line 272 of file qgscomposermap.h.
| void QgsComposerMap::assignFreeId | ( | ) |
Sets mId to a number not yet used in the composition.
mId is kept if it is not in use. Usually, this function is called before adding the composer map to the composition
Definition at line 2262 of file qgscomposermap.cpp.
References QgsComposition::composerMapItems(), QgsComposition::getComposerMapById(), QgsComposerItem::mComposition, and mId.
Referenced by QgsComposition::addItemsFromXML(), and QgsComposerMap().
| QgsComposerMap::Border QgsComposerMap::borderForLineCoord | ( | const QPointF & | p | ) | const [private] |
Returns the item border of a point (in item coordinates)
Definition at line 1878 of file qgscomposermap.cpp.
References Bottom, Left, Right, and Top.
Referenced by drawCoordinateAnnotation(), and sortGridLinesOnBorders().
| QRectF QgsComposerMap::boundingRect | ( | ) | const |
In case of annotations, the bounding rectangle can be larger than the map item rectangle.
Definition at line 1641 of file qgscomposermap.cpp.
References mCurrentRectangle.
| void QgsComposerMap::cache | ( | void | ) |
Create cache image.
Definition at line 200 of file qgscomposermap.cpp.
References QgsComposerItem::backgroundColor(), draw(), QgsComposerItem::hasBackground(), QgsRectangle::height(), QgsComposerItem::horizontalViewScaleFactor(), mapUnitsToMM(), mCacheImage, mCacheUpdated, mDrawing, mExtent, QgsComposerItem::mLastValidViewScaleFactor, mPreviewMode, Rectangle, requestedExtent(), QgsRectangle::width(), QgsRectangle::xMinimum(), and QgsRectangle::yMinimum().
Referenced by QgsComposition::addComposerMap(), QgsAtlasComposition::endRender(), moveContent(), setNewScale(), updateCachedImage(), updateItem(), and zoomContent().
| QPointF QgsComposerMap::composerMapPosForItem | ( | const QGraphicsItem * | item | ) | const [private] |
Definition at line 2006 of file qgscomposermap.cpp.
References QgsMapRenderer::extent(), QgsRectangle::height(), mapToItemCoords(), mExtent, mMapCanvas, mMapRenderer, QgsRectangle::width(), QgsRectangle::xMinimum(), and QgsRectangle::yMaximum().
Referenced by drawCanvasItem().
| void QgsComposerMap::connectUpdateSlot | ( | ) | [private] |
Establishes signal/slot connection for update in case of layer change.
Definition at line 695 of file qgscomposermap.cpp.
References QgsMapLayerRegistry::instance(), and updateCachedImage().
Referenced by QgsComposerMap().
| bool QgsComposerMap::containsAdvancedEffects | ( | ) | const |
True if composer map contains layers with blend modes or flattened layers for vectors.
Definition at line 638 of file qgscomposermap.cpp.
References QgsMapLayer::blendMode(), QgsPalLayerSettings::blendMode, QgsPalLayerSettings::bufferBlendMode, QgsPalLayerSettings::bufferSize, QgsVectorLayer::featureBlendMode(), QgsMapLayer::id(), QgsMapLayerRegistry::instance(), QgsMapRenderer::labelingEngine(), QgsPalLabeling::layer(), QgsMapRenderer::layerSet(), QgsVectorLayer::layerTransparency(), QgsMapLayerRegistry::mapLayer(), mMapRenderer, QgsPalLayerSettings::shadowBlendMode, QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::shapeBlendMode, QgsPalLayerSettings::shapeDraw, and QgsPalLabeling::willUseLayer().
| bool QgsComposerMap::containsWMSLayer | ( | ) | const |
True if composer map renders a WMS layer.
Definition at line 604 of file qgscomposermap.cpp.
References QgsRasterLayer::dataProvider(), QgsMapLayerRegistry::instance(), QgsMapRenderer::layerSet(), QgsMapLayerRegistry::mapLayer(), mMapRenderer, and QgsDataProvider::name().
| void QgsComposerMap::createDefaultGridLineSymbol | ( | ) | [private] |
Definition at line 2228 of file qgscomposermap.cpp.
References QgsLineSymbolV2::createSimple(), and mGridLineSymbol.
Referenced by QgsComposerMap().
| void QgsComposerMap::createDefaultOverviewFrameSymbol | ( | ) | [private] |
Definition at line 2217 of file qgscomposermap.cpp.
References QgsFillSymbolV2::createSimple(), mOverviewFrameMapSymbol, and QgsSymbolV2::setAlpha().
Referenced by QgsComposerMap().
| double QgsComposerMap::crossLength | ( | ) | [inline] |
Definition at line 300 of file qgscomposermap.h.
| void QgsComposerMap::draw | ( | QPainter * | painter, |
| const QgsRectangle & | extent, | ||
| const QSizeF & | size, | ||
| double | dpi, | ||
| double * | forceWidthScale = 0 |
||
| ) |
Draw to paint device.
| painter | painter |
| extent | map extent |
| size | size in scene coordinates |
| dpi | scene dpi |
| forceWidthScale | force wysiwyg line widths / marker sizes |
Definition at line 127 of file qgscomposermap.cpp.
References QgsLabelingEngineInterface::clone(), QgsMapRenderer::destinationCrs(), QgsMapRenderer::hasCrsTransformEnabled(), QgsMapRenderer::labelingEngine(), QgsMapRenderer::layerSet(), QgsComposerItem::mComposition, mKeepLayerSet, mLayerSet, mMapRenderer, QgsMapRenderer::render(), QgsMapRenderer::rendererContext(), scale(), QgsMapRenderer::scale(), QgsMapRenderer::setDestinationCrs(), QgsRenderContext::setDrawEditingInformation(), QgsMapRenderer::setExtent(), QgsRenderContext::setForceVectorOutput(), QgsMapRenderer::setLabelingEngine(), QgsMapRenderer::setLayerSet(), QgsMapRenderer::setOutputSize(), QgsMapRenderer::setProjectionsEnabled(), QgsRenderContext::setRenderingStopped(), QgsMapRenderer::setScale(), QgsRenderContext::setUseAdvancedEffects(), and QgsComposition::useAdvancedEffects().
| void QgsComposerMap::drawAnnotation | ( | QPainter * | p, |
| const QPointF & | pos, | ||
| int | rotation, | ||
| const QString & | annotationText | ||
| ) | [private] |
Draws a single annotation.
| p | drawing painter |
| pos | item coordinates where to draw |
| rotation | text rotation |
| annotationText | the text to draw |
Definition at line 1420 of file qgscomposermap.cpp.
References QgsComposerItem::drawText(), mGridAnnotationFont, and mGridAnnotationFontColor.
Referenced by drawCoordinateAnnotation().
| void QgsComposerMap::drawCanvasItem | ( | QGraphicsItem * | item, |
| QPainter * | painter, | ||
| const QStyleOptionGraphicsItem * | itemStyle | ||
| ) | [private] |
Definition at line 1961 of file qgscomposermap.cpp.
References composerMapPosForItem(), QgsMapRenderer::extent(), mExtent, mMapCanvas, and mMapRenderer.
Referenced by drawCanvasItems().
| bool QgsComposerMap::drawCanvasItems | ( | ) | const [inline] |
Definition at line 310 of file qgscomposermap.h.
Referenced by paint().
| void QgsComposerMap::drawCanvasItems | ( | QPainter * | painter, |
| const QStyleOptionGraphicsItem * | itemStyle | ||
| ) | [private] |
Definition at line 1898 of file qgscomposermap.cpp.
References drawCanvasItem(), mDrawCanvasItems, and mMapCanvas.
| void QgsComposerMap::drawCoordinateAnnotation | ( | QPainter * | p, |
| const QPointF & | pos, | ||
| QString | annotationString | ||
| ) | [private] |
Definition at line 1262 of file qgscomposermap.cpp.
References borderForLineCoord(), Bottom, BoundaryDirection, drawAnnotation(), QgsComposerItem::fontHeightCharacterMM(), Horizontal, InsideMapFrame, Left, mAnnotationFrameDistance, mBottomGridAnnotationDirection, mBottomGridAnnotationPosition, mGridAnnotationFont, mGridFrameStyle, mGridFrameWidth, mLeftGridAnnotationDirection, mLeftGridAnnotationPosition, mRightGridAnnotationDirection, mRightGridAnnotationPosition, mTopGridAnnotationDirection, mTopGridAnnotationPosition, NoGridFrame, OutsideMapFrame, Right, QgsComposerItem::rotation(), QgsComposerItem::textWidthMillimeters(), and Vertical.
Referenced by drawCoordinateAnnotations().
| void QgsComposerMap::drawCoordinateAnnotations | ( | QPainter * | p, |
| const QList< QPair< double, QLineF > > & | hLines, | ||
| const QList< QPair< double, QLineF > > & | vLines | ||
| ) | [private] |
Draw coordinates for mGridAnnotationType Coordinate.
| p | drawing painter |
| hLines | horizontal coordinate lines in item coordinates |
| vLines | vertical coordinate lines in item coordinates |
Definition at line 1236 of file qgscomposermap.cpp.
References drawCoordinateAnnotation(), gridAnnotationString(), Latitude, and Longitude.
Referenced by drawGrid().
| void QgsComposerMap::drawGrid | ( | QPainter * | p | ) | [private] |
Draws the map grid.
Definition at line 1054 of file qgscomposermap.cpp.
References drawCoordinateAnnotations(), drawGridFrame(), drawGridLine(), mCrossLength, mGridBlendMode, mGridFrameStyle, mGridStyle, mShowGridAnnotation, NoGridFrame, QgsSymbolLayerV2Utils::pointOnLineWithDistance(), Solid, xGridLines(), and yGridLines().
Referenced by paint().
| void QgsComposerMap::drawGridFrame | ( | QPainter * | p, |
| const QList< QPair< double, QLineF > > & | hLines, | ||
| const QList< QPair< double, QLineF > > & | vLines | ||
| ) | [private] |
Definition at line 1147 of file qgscomposermap.cpp.
References Bottom, drawGridFrameBorder(), Left, Right, sortGridLinesOnBorders(), and Top.
Referenced by drawGrid().
| void QgsComposerMap::drawGridFrameBorder | ( | QPainter * | p, |
| const QMap< double, double > & | borderPos, | ||
| Border | border | ||
| ) | [private] |
Definition at line 1190 of file qgscomposermap.cpp.
References Left, mGridFrameWidth, Right, and Top.
Referenced by drawGridFrame().
| void QgsComposerMap::drawGridLine | ( | const QLineF & | line, |
| QPainter * | p | ||
| ) | [private] |
Definition at line 1163 of file qgscomposermap.cpp.
References QgsComposerItem::mComposition, mGridLineSymbol, mPreviewMode, QgsComposition::printResolution(), Rectangle, QgsLineSymbolV2::renderPolyline(), QgsRenderContext::setPainter(), QgsRenderContext::setRasterScaleFactor(), QgsRenderContext::setScaleFactor(), QgsSymbolV2::startRender(), and QgsSymbolV2::stopRender().
Referenced by drawGrid().
| void QgsComposerMap::drawOverviewMapExtent | ( | QPainter * | p | ) | [private] |
Definition at line 2154 of file qgscomposermap.cpp.
References extent(), QgsComposition::getComposerMapById(), QgsRectangle::height(), QgsRectangle::intersect(), QgsComposerItem::mComposition, mOverviewBlendMode, mOverviewFrameMapId, mOverviewFrameMapSymbol, mOverviewInverted, mPreviewMode, QgsComposition::printResolution(), Rectangle, QgsFillSymbolV2::renderPolygon(), QgsRenderContext::setPainter(), QgsRenderContext::setRasterScaleFactor(), QgsRenderContext::setScaleFactor(), QgsSymbolV2::startRender(), QgsSymbolV2::stopRender(), QgsRectangle::width(), QgsRectangle::xMinimum(), and QgsRectangle::yMaximum().
Referenced by paint().
| QgsRectangle QgsComposerMap::extent | ( | ) | const [inline] |
Definition at line 176 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::beginRender(), drawOverviewMapExtent(), QgsComposerAttributeTable::getFeatureAttributes(), QgsComposerScaleBar::mapWidth(), QgsComposerScaleBar::refreshSegmentMillimeters(), and setNewExtent().
| void QgsComposerMap::extentChanged | ( | ) | [signal] |
Referenced by moveContent(), setNewScale(), setOverviewFrameMap(), setSceneRect(), and zoomContent().
| QgsComposerMap::GridAnnotationDirection QgsComposerMap::gridAnnotationDirection | ( | QgsComposerMap::Border | border | ) | const |
Definition at line 2094 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationDirection, mLeftGridAnnotationDirection, mRightGridAnnotationDirection, mTopGridAnnotationDirection, Right, and Top.
| QFont QgsComposerMap::gridAnnotationFont | ( | ) | const [inline] |
Definition at line 247 of file qgscomposermap.h.
| GridAnnotationFormat QgsComposerMap::gridAnnotationFormat | ( | ) | const [inline] |
Definition at line 278 of file qgscomposermap.h.
| QgsComposerMap::GridAnnotationPosition QgsComposerMap::gridAnnotationPosition | ( | QgsComposerMap::Border | border | ) | const |
Definition at line 2050 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationPosition, mLeftGridAnnotationPosition, mRightGridAnnotationPosition, mTopGridAnnotationPosition, Right, and Top.
| int QgsComposerMap::gridAnnotationPrecision | ( | ) | const [inline] |
Definition at line 259 of file qgscomposermap.h.
| QString QgsComposerMap::gridAnnotationString | ( | double | value, |
| AnnotationCoordinate | coord | ||
| ) | const [private] |
Definition at line 1430 of file qgscomposermap.cpp.
References Decimal, DegreeMinute, Longitude, mGridAnnotationFormat, mGridAnnotationPrecision, QgsPoint::setX(), QgsPoint::setY(), QgsPoint::toDegreesMinutes(), and QgsPoint::toDegreesMinutesSeconds().
Referenced by drawCoordinateAnnotations(), and maxExtension().
| QPainter::CompositionMode QgsComposerMap::gridBlendMode | ( | ) | const [inline] |
Returns the grid's blending mode.
Definition at line 339 of file qgscomposermap.h.
| bool QgsComposerMap::gridEnabled | ( | ) | const [inline] |
Definition at line 204 of file qgscomposermap.h.
| GridFrameStyle QgsComposerMap::gridFrameStyle | ( | ) | const [inline] |
Definition at line 283 of file qgscomposermap.h.
| double QgsComposerMap::gridFrameWidth | ( | ) | const [inline] |
Definition at line 288 of file qgscomposermap.h.
| double QgsComposerMap::gridIntervalX | ( | ) | const [inline] |
Definition at line 214 of file qgscomposermap.h.
| double QgsComposerMap::gridIntervalY | ( | ) | const [inline] |
Definition at line 219 of file qgscomposermap.h.
| QgsLineSymbolV2* QgsComposerMap::gridLineSymbol | ( | ) | [inline] |
Definition at line 336 of file qgscomposermap.h.
| double QgsComposerMap::gridOffsetX | ( | ) | const [inline] |
Definition at line 224 of file qgscomposermap.h.
| double QgsComposerMap::gridOffsetY | ( | ) | const [inline] |
Definition at line 229 of file qgscomposermap.h.
| QPen QgsComposerMap::gridPen | ( | ) | const |
Definition at line 1623 of file qgscomposermap.cpp.
References QgsSymbolV2::color(), mGridLineSymbol, and QgsLineSymbolV2::width().
| GridStyle QgsComposerMap::gridStyle | ( | ) | const [inline] |
Definition at line 209 of file qgscomposermap.h.
| int QgsComposerMap::id | ( | ) | const [inline] |
Get identification number.
Reimplemented from QgsComposerItem.
Definition at line 123 of file qgscomposermap.h.
References QgsComposerItem::mId.
Referenced by QgsComposition::getComposerMapById(), QgsComposerPicture::rotationMap(), QgsComposerAttributeTable::writeXML(), QgsComposerPicture::writeXML(), QgsAtlasComposition::writeXML(), QgsComposerLegend::writeXML(), and QgsComposerScaleBar::writeXML().
| void QgsComposerMap::initGridAnnotationFormatFromProject | ( | ) | [private] |
Definition at line 2238 of file qgscomposermap.cpp.
References Decimal, DegreeMinute, DegreeMinuteSecond, QGis::Degrees, QgsProject::instance(), QgsMapRenderer::mapUnits(), mGridAnnotationFormat, mMapRenderer, and QgsProject::readEntry().
Referenced by QgsComposerMap().
| bool QgsComposerMap::isDrawing | ( | ) | const [inline] |
True if a draw is already in progress.
Definition at line 126 of file qgscomposermap.h.
Referenced by QgsComposerAttributeTable::paint(), and QgsComposition::removeComposerItem().
| bool QgsComposerMap::keepLayerSet | ( | ) | const [inline] |
Getter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas.
Definition at line 159 of file qgscomposermap.h.
| QStringList QgsComposerMap::layerSet | ( | ) | const [inline] |
Getter for stored layer set that is used if mKeepLayerSet is true.
Definition at line 166 of file qgscomposermap.h.
Referenced by readXML().
| void QgsComposerMap::mapPolygon | ( | QPolygonF & | poly | ) | const [private] |
Returns the polygon of the map extent.
If rotation == 0, the result is the same as mExtent
| poly | out: the result polygon with the four corner points. The points are clockwise, starting at the top-left point |
Definition at line 1730 of file qgscomposermap.cpp.
References mExtent, QgsComposerItem::mRotation, QgsComposerItem::rotate(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by requestedExtent(), transformedMapPolygon(), xGridLines(), and yGridLines().
| const QgsMapRenderer* QgsComposerMap::mapRenderer | ( | ) | const [inline] |
Definition at line 178 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::beginRender(), QgsComposerAttributeTable::getFeatureAttributes(), and QgsComposerScaleBar::mapWidth().
| QPointF QgsComposerMap::mapToItemCoords | ( | const QPointF & | mapCoords | ) | const [private] |
Transforms map coordinates to item coordinates (considering rotation and move offset)
Definition at line 1857 of file qgscomposermap.cpp.
References QgsComposerItem::mRotation, QgsComposerItem::rotate(), transformedExtent(), transformedMapPolygon(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by composerMapPosForItem(), xGridLines(), and yGridLines().
| double QgsComposerMap::mapUnitsToMM | ( | ) | const |
Returns the conversion factor map units -> mm.
Definition at line 1789 of file qgscomposermap.cpp.
References mExtent, and QgsRectangle::width().
Referenced by cache(), QgsComposerLegend::drawSymbolV2(), paint(), and transformShift().
| double QgsComposerMap::maxExtension | ( | ) | const [private] |
Definition at line 1686 of file qgscomposermap.cpp.
References QgsComposerItem::fontAscentMillimeters(), gridAnnotationString(), Latitude, Longitude, mAnnotationFrameDistance, mBottomGridAnnotationPosition, mGridAnnotationFont, mGridEnabled, mGridFrameStyle, mGridFrameWidth, mLeftGridAnnotationPosition, mRightGridAnnotationPosition, mShowGridAnnotation, mTopGridAnnotationPosition, NoGridFrame, OutsideMapFrame, QgsComposerItem::textWidthMillimeters(), xGridLines(), and yGridLines().
Referenced by updateBoundingRect().
| void QgsComposerMap::moveContent | ( | double | dx, |
| double | dy | ||
| ) | [virtual] |
Move content of map.
| dx | move in x-direction (item and canvas coordinates) |
| dy | move in y-direction (item and canvas coordinates) |
Reimplemented from QgsComposerItem.
Definition at line 438 of file qgscomposermap.cpp.
References cache(), extentChanged(), QgsComposerItem::itemChanged(), mDrawing, mExtent, QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), transformShift(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
| QPainter::CompositionMode QgsComposerMap::overviewBlendMode | ( | ) | const [inline] |
Returns the overview's blending mode.
Definition at line 326 of file qgscomposermap.h.
| int QgsComposerMap::overviewFrameMapId | ( | ) | const [inline] |
Returns id of overview frame (or -1 if no overfiew frame)
Definition at line 320 of file qgscomposermap.h.
| QgsFillSymbolV2* QgsComposerMap::overviewFrameMapSymbol | ( | ) | [inline] |
Definition at line 323 of file qgscomposermap.h.
| bool QgsComposerMap::overviewInverted | ( | ) | const [inline] |
Returns true if the overview frame is inverted.
Definition at line 331 of file qgscomposermap.h.
| void QgsComposerMap::paint | ( | QPainter * | painter, |
| const QStyleOptionGraphicsItem * | itemStyle, | ||
| QWidget * | pWidget | ||
| ) |
Reimplementation of QCanvasItem::paint - draw on canvas.
Definition at line 267 of file qgscomposermap.cpp.
References draw(), QgsComposerItem::drawBackground(), drawCanvasItems(), QgsComposerItem::drawFrame(), drawGrid(), drawOverviewMapExtent(), QgsComposerItem::drawSelectionBoxes(), QgsRectangle::height(), QgsComposerItem::horizontalViewScaleFactor(), mapUnitsToMM(), mCacheImage, QgsComposerItem::mComposition, mDrawing, mExtent, mGridEnabled, QgsComposerItem::mLastValidViewScaleFactor, mOverviewFrameMapId, mPreviewMode, QgsComposerItem::mRotation, mXOffset, mYOffset, QgsComposition::plotStyle(), QgsComposition::Postscript, QgsComposition::Preview, QgsComposition::Print, Rectangle, requestedExtent(), scale(), tr, QgsRectangle::width(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
| PreviewMode QgsComposerMap::previewMode | ( | ) | const [inline] |
Definition at line 154 of file qgscomposermap.h.
Referenced by QgsComposition::addComposerMap(), QgsComposition::addItemsFromXML(), and readXML().
| bool QgsComposerMap::readXML | ( | const QDomElement & | itemElem, |
| const QDomDocument & | doc | ||
| ) | [virtual] |
sets state from Dom document
| itemElem | is Dom node corresponding to 'ComposerMap' tag |
| doc | is Dom document |
Implements QgsComposerItem.
Definition at line 832 of file qgscomposermap.cpp.
References QgsComposerItem::_readXML(), Cache, QgsLineSymbolV2::createSimple(), QgsMapRenderer::getCompositionMode(), QgsComposerItem::itemChanged(), layerSet(), QgsSymbolLayerV2Utils::loadSymbol(), mAnnotationFrameDistance, mBottomGridAnnotationDirection, mBottomGridAnnotationPosition, mCacheUpdated, mCrossLength, mDrawCanvasItems, mDrawing, mExtent, mGridAnnotationFont, mGridAnnotationFontColor, mGridAnnotationFormat, mGridAnnotationPrecision, mGridEnabled, mGridFrameStyle, mGridFrameWidth, mGridIntervalX, mGridIntervalY, mGridLineSymbol, mGridOffsetX, mGridOffsetY, mGridStyle, mId, mKeepLayerSet, mLayerSet, mLeftGridAnnotationDirection, mLeftGridAnnotationPosition, mNumCachedLayers, mOverviewFrameMapSymbol, mPreviewMode, mRightGridAnnotationDirection, mRightGridAnnotationPosition, mShowGridAnnotation, mTopGridAnnotationDirection, mTopGridAnnotationPosition, previewMode(), Rectangle, Render, QgsSymbolV2::setColor(), setGridBlendMode(), setOverviewBlendMode(), setOverviewFrameMap(), setOverviewInverted(), QgsLineSymbolV2::setWidth(), and updateBoundingRect().
Referenced by QgsComposition::addItemsFromXML().
| void QgsComposerMap::renderModeUpdateCachedImage | ( | ) | [slot] |
Call updateCachedImage if item is in render mode.
Definition at line 408 of file qgscomposermap.cpp.
References mPreviewMode, Render, and updateCachedImage().
| void QgsComposerMap::requestedExtent | ( | QgsRectangle & | extent | ) | const [private] |
Calculates the extent to request and the yShift of the top-left point in case of rotation.
Definition at line 1771 of file qgscomposermap.cpp.
References mapPolygon(), mExtent, QgsComposerItem::mRotation, QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), and QgsRectangle::setYMinimum().
| void QgsComposerMap::resize | ( | double | dx, |
| double | dy | ||
| ) |
resizes an item in x- and y direction (canvas coordinates)
Definition at line 429 of file qgscomposermap.cpp.
References setSceneRect(), and updateItem().
| double QgsComposerMap::scale | ( | ) | const |
Scale.
Definition at line 421 of file qgscomposermap.cpp.
References QgsScaleCalculator::calculate(), QgsMapRenderer::mapUnits(), mExtent, mMapRenderer, QgsScaleCalculator::setDpi(), and QgsScaleCalculator::setMapUnits().
Referenced by draw(), paint(), QgsNumericScaleBarStyle::scaleText(), and setNewScale().
| void QgsComposerMap::setAnnotationFontColor | ( | const QColor & | c | ) | [inline] |
Sets font color for grid annotations.
Definition at line 251 of file qgscomposermap.h.
| void QgsComposerMap::setAnnotationFrameDistance | ( | double | d | ) | [inline] |
Sets distance between map frame and annotations.
Definition at line 271 of file qgscomposermap.h.
| void QgsComposerMap::setCacheUpdated | ( | bool | u = false | ) |
Definition at line 416 of file qgscomposermap.cpp.
References mCacheUpdated.
| void QgsComposerMap::setCrossLength | ( | double | l | ) | [inline] |
Sets length of the cros segments (if grid style is cross)
Definition at line 299 of file qgscomposermap.h.
| void QgsComposerMap::setDrawCanvasItems | ( | bool | b | ) | [inline] |
Definition at line 309 of file qgscomposermap.h.
| void QgsComposerMap::setGridAnnotationDirection | ( | GridAnnotationDirection | d, |
| QgsComposerMap::Border | border | ||
| ) |
Definition at line 2070 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationDirection, mLeftGridAnnotationDirection, mRightGridAnnotationDirection, mTopGridAnnotationDirection, Right, Top, and updateBoundingRect().
| void QgsComposerMap::setGridAnnotationFont | ( | const QFont & | f | ) | [inline] |
Sets font for grid annotations.
Definition at line 246 of file qgscomposermap.h.
| void QgsComposerMap::setGridAnnotationFormat | ( | GridAnnotationFormat | f | ) | [inline] |
Definition at line 277 of file qgscomposermap.h.
| void QgsComposerMap::setGridAnnotationPosition | ( | GridAnnotationPosition | p, |
| QgsComposerMap::Border | border | ||
| ) |
Definition at line 2027 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationPosition, mLeftGridAnnotationPosition, mRightGridAnnotationPosition, mTopGridAnnotationPosition, Right, Top, and updateBoundingRect().
| void QgsComposerMap::setGridAnnotationPrecision | ( | int | p | ) | [inline] |
Sets coordinate precision for grid annotations.
Definition at line 258 of file qgscomposermap.h.
| void QgsComposerMap::setGridBlendMode | ( | QPainter::CompositionMode | blendMode | ) |
Sets the grid's blending mode.
Definition at line 1635 of file qgscomposermap.cpp.
References QgsComposerItem::blendMode(), and mGridBlendMode.
Referenced by readXML().
| void QgsComposerMap::setGridEnabled | ( | bool | enabled | ) | [inline] |
Enables a coordinate grid that is shown on top of this composermap.
Definition at line 203 of file qgscomposermap.h.
| void QgsComposerMap::setGridFrameStyle | ( | GridFrameStyle | style | ) | [inline] |
Set grid frame style (NoGridFrame or Zebra)
Definition at line 282 of file qgscomposermap.h.
| void QgsComposerMap::setGridFrameWidth | ( | double | w | ) | [inline] |
Set grid frame width.
Definition at line 287 of file qgscomposermap.h.
| void QgsComposerMap::setGridIntervalX | ( | double | interval | ) | [inline] |
Sets coordinate interval in x-direction for composergrid.
Definition at line 213 of file qgscomposermap.h.
| void QgsComposerMap::setGridIntervalY | ( | double | interval | ) | [inline] |
Sets coordinate interval in y-direction for composergrid.
Definition at line 218 of file qgscomposermap.h.
| void QgsComposerMap::setGridLineSymbol | ( | QgsLineSymbolV2 * | symbol | ) |
Definition at line 1839 of file qgscomposermap.cpp.
References mGridLineSymbol.
| void QgsComposerMap::setGridOffsetX | ( | double | offset | ) | [inline] |
Sets x-coordinate offset for composer grid.
Definition at line 223 of file qgscomposermap.h.
| void QgsComposerMap::setGridOffsetY | ( | double | offset | ) | [inline] |
Sets y-coordinate offset for composer grid.
Definition at line 228 of file qgscomposermap.h.
| void QgsComposerMap::setGridPen | ( | const QPen & | p | ) |
Sets the pen to draw composer grid.
Definition at line 1617 of file qgscomposermap.cpp.
References setGridPenColor(), and setGridPenWidth().
| void QgsComposerMap::setGridPenColor | ( | const QColor & | c | ) |
Sets the color of the grid pen.
Definition at line 1609 of file qgscomposermap.cpp.
References mGridLineSymbol, and QgsSymbolV2::setColor().
Referenced by setGridPen().
| void QgsComposerMap::setGridPenWidth | ( | double | w | ) |
Sets with of grid pen.
Definition at line 1601 of file qgscomposermap.cpp.
References mGridLineSymbol, and QgsLineSymbolV2::setWidth().
Referenced by setGridPen().
| void QgsComposerMap::setGridStyle | ( | GridStyle | style | ) | [inline] |
Sets coordinate grid style to solid or cross.
Definition at line 208 of file qgscomposermap.h.
| void QgsComposerMap::setKeepLayerSet | ( | bool | enabled | ) | [inline] |
Setter for flag that determines if the stored layer set should be used or the current layer set of the qgis mapcanvas.
Definition at line 162 of file qgscomposermap.h.
| void QgsComposerMap::setLayerSet | ( | const QStringList & | layerSet | ) | [inline] |
Setter for stored layer set that is used if mKeepLayerSet is true.
Definition at line 169 of file qgscomposermap.h.
| void QgsComposerMap::setMapCanvas | ( | QGraphicsView * | canvas | ) | [inline] |
Sets canvas pointer (necessary to query and draw map canvas items)
Definition at line 307 of file qgscomposermap.h.
| void QgsComposerMap::setMapRotation | ( | double | r | ) |
Definition at line 588 of file qgscomposermap.cpp.
References QgsComposerItem::itemChanged(), QgsComposerItem::rotationChanged(), and QgsComposerItem::setRotation().
| void QgsComposerMap::setNewExtent | ( | const QgsRectangle & | extent | ) |
Sets new Extent and changes width, height (and implicitely also scale)
Definition at line 541 of file qgscomposermap.cpp.
References extent(), QgsRectangle::height(), mExtent, setSceneRect(), updateItem(), and QgsRectangle::width().
Referenced by QgsAtlasComposition::endRender(), and QgsAtlasComposition::prepareForFeature().
| void QgsComposerMap::setNewScale | ( | double | scaleDenominator | ) |
Sets new scale and changes only mExtent.
Definition at line 558 of file qgscomposermap.cpp.
References cache(), extentChanged(), QgsComposerItem::itemChanged(), mCacheUpdated, mExtent, QgsRectangle::scale(), and scale().
| void QgsComposerMap::setOffset | ( | double | xOffset, |
| double | yOffset | ||
| ) |
Sets offset values to shift image (useful for live updates when moving item content)
Definition at line 582 of file qgscomposermap.cpp.
References mXOffset, and mYOffset.
Referenced by QgsComposerView::mouseMoveEvent(), and QgsComposerView::mouseReleaseEvent().
| void QgsComposerMap::setOverviewBlendMode | ( | QPainter::CompositionMode | blendMode | ) |
Sets the overview's blending mode.
Definition at line 1827 of file qgscomposermap.cpp.
References QgsComposerItem::blendMode(), and mOverviewBlendMode.
Referenced by readXML().
| void QgsComposerMap::setOverviewFrameMap | ( | int | mapId | ) |
Sets overview frame map.
-1 disables the overview frame
Definition at line 1799 of file qgscomposermap.cpp.
References extentChanged(), QgsComposition::getComposerMapById(), QgsComposerItem::mComposition, mOverviewFrameMapId, and QgsComposerItem::repaint().
Referenced by readXML().
| void QgsComposerMap::setOverviewFrameMapSymbol | ( | QgsFillSymbolV2 * | symbol | ) |
Definition at line 1821 of file qgscomposermap.cpp.
References mOverviewFrameMapSymbol.
| void QgsComposerMap::setOverviewInverted | ( | bool | inverted | ) |
Sets the overview's inversion mode.
Definition at line 1833 of file qgscomposermap.cpp.
References mOverviewInverted.
Referenced by readXML().
| void QgsComposerMap::setPreviewMode | ( | PreviewMode | m | ) |
Definition at line 576 of file qgscomposermap.cpp.
References QgsComposerItem::itemChanged(), and mPreviewMode.
Referenced by QgsComposition::addComposerMap(), and QgsComposition::addItemsFromXML().
| void QgsComposerMap::setSceneRect | ( | const QRectF & | rectangle | ) | [virtual] |
Sets new scene rectangle bounds and recalculates hight and extent.
Reimplemented from QgsComposerItem.
Definition at line 522 of file qgscomposermap.cpp.
References extentChanged(), QgsComposerItem::itemChanged(), mCacheUpdated, mExtent, updateBoundingRect(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), and QgsRectangle::yMinimum().
Referenced by QgsComposerMap(), resize(), and setNewExtent().
| void QgsComposerMap::setShowGridAnnotation | ( | bool | show | ) | [inline] |
Sets flag if grid annotation should be shown.
Definition at line 263 of file qgscomposermap.h.
| bool QgsComposerMap::showGridAnnotation | ( | ) | const [inline] |
Definition at line 264 of file qgscomposermap.h.
| void QgsComposerMap::sortGridLinesOnBorders | ( | const QList< QPair< double, QLineF > > & | hLines, |
| const QList< QPair< double, QLineF > > & | vLines, | ||
| QMap< double, double > & | leftFrameEntries, | ||
| QMap< double, double > & | rightFrameEntries, | ||
| QMap< double, double > & | topFrameEntries, | ||
| QMap< double, double > & | bottomFrameEntries | ||
| ) | const [private] |
Definition at line 2114 of file qgscomposermap.cpp.
References borderForLineCoord(), Left, Right, and Top.
Referenced by drawGridFrame().
| void QgsComposerMap::storeCurrentLayerSet | ( | ) |
Stores the current layer set of the qgis mapcanvas in mLayerSet.
Definition at line 1019 of file qgscomposermap.cpp.
References QgsMapRenderer::layerSet(), mLayerSet, and mMapRenderer.
| void QgsComposerMap::syncLayerSet | ( | ) | [private] |
Removes layer ids from mLayerSet that are no longer present in the qgis main map.
Definition at line 1027 of file qgscomposermap.cpp.
References QgsMapLayerRegistry::instance(), QgsMapRenderer::layerSet(), QgsMapLayerRegistry::mapLayers(), mKeepLayerSet, mLayerSet, and mMapRenderer.
Referenced by updateCachedImage().
| QgsRectangle QgsComposerMap::transformedExtent | ( | ) | const [private] |
Returns extent that considers mOffsetX / mOffsetY (during content move)
Definition at line 1661 of file qgscomposermap.cpp.
References mExtent, mXOffset, mYOffset, transformShift(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by mapToItemCoords().
| QPolygonF QgsComposerMap::transformedMapPolygon | ( | ) | const [private] |
Returns extent that considers rotation and shift with mOffsetX / mOffsetY.
Definition at line 1669 of file qgscomposermap.cpp.
References mapPolygon(), mXOffset, mYOffset, and transformShift().
Referenced by mapToItemCoords(), xGridLines(), and yGridLines().
| void QgsComposerMap::transformShift | ( | double & | xShift, |
| double & | yShift | ||
| ) | const [private] |
Scales a composer map shift (in MM) and rotates it by mRotation.
| xShift | in: shift in x direction (in item units), out: xShift in map units |
| yShift | in: shift in y direction (in item units), out: yShift in map units |
Definition at line 1845 of file qgscomposermap.cpp.
References mapUnitsToMM(), QgsComposerItem::mRotation, and QgsComposerItem::rotate().
Referenced by moveContent(), transformedExtent(), and transformedMapPolygon().
| virtual int QgsComposerMap::type | ( | ) | const [inline, virtual] |
return correct graphics item type.
Added in v1.7
Reimplemented from QgsComposerItem.
Definition at line 54 of file qgscomposermap.h.
References QgsComposerItem::ComposerMap.
| void QgsComposerMap::updateBoundingRect | ( | ) |
Updates the bounding rect of this item.
Call this function before doing any changes related to annotation out of the map rectangle
Definition at line 1646 of file qgscomposermap.cpp.
References maxExtension(), and mCurrentRectangle.
Referenced by readXML(), setGridAnnotationDirection(), setGridAnnotationPosition(), and setSceneRect().
| void QgsComposerMap::updateCachedImage | ( | void | ) | [slot] |
Called if map canvas has changed.
Definition at line 400 of file qgscomposermap.cpp.
References cache(), mCacheUpdated, and syncLayerSet().
Referenced by connectUpdateSlot(), and renderModeUpdateCachedImage().
| void QgsComposerMap::updateItem | ( | ) | [virtual] |
Updates item, with the possibility to do custom update for subclasses.
Reimplemented from QgsComposerItem.
Definition at line 595 of file qgscomposermap.cpp.
References cache(), mCacheUpdated, mPreviewMode, and Rectangle.
Referenced by resize(), and setNewExtent().
| bool QgsComposerMap::writeXML | ( | QDomElement & | elem, |
| QDomDocument & | doc | ||
| ) | const [virtual] |
stores state in Dom node
| elem | is Dom element corresponding to 'Composer' tag |
| doc | Dom document |
Implements QgsComposerItem.
Definition at line 706 of file qgscomposermap.cpp.
References QgsComposerItem::_writeXML(), Cache, QgsMapRenderer::getBlendModeEnum(), mAnnotationFrameDistance, mBottomGridAnnotationDirection, mBottomGridAnnotationPosition, mCrossLength, mDrawCanvasItems, mExtent, mGridAnnotationFont, mGridAnnotationFontColor, mGridAnnotationFormat, mGridAnnotationPrecision, mGridBlendMode, mGridEnabled, mGridFrameStyle, mGridFrameWidth, mGridIntervalX, mGridIntervalY, mGridLineSymbol, mGridOffsetX, mGridOffsetY, mGridStyle, mId, mKeepLayerSet, mLayerSet, mLeftGridAnnotationDirection, mLeftGridAnnotationPosition, mOverviewBlendMode, mOverviewFrameMapId, mOverviewFrameMapSymbol, mOverviewInverted, mPreviewMode, mRightGridAnnotationDirection, mRightGridAnnotationPosition, mShowGridAnnotation, mTopGridAnnotationDirection, mTopGridAnnotationPosition, Render, QgsSymbolLayerV2Utils::saveSymbol(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
| int QgsComposerMap::xGridLines | ( | QList< QPair< double, QLineF > > & | lines | ) | const [private] |
Returns the grid lines with associated coordinate value.
Definition at line 1466 of file qgscomposermap.cpp.
References mapPolygon(), mapToItemCoords(), mGridIntervalY, mGridOffsetY, QgsComposerItem::mRotation, qgsDoubleNear(), and transformedMapPolygon().
Referenced by drawGrid(), and maxExtension().
| int QgsComposerMap::yGridLines | ( | QList< QPair< double, QLineF > > & | lines | ) | const [private] |
Returns the grid lines for the y-coordinates.
Not vertical in case of rotation
Definition at line 1535 of file qgscomposermap.cpp.
References mapPolygon(), mapToItemCoords(), mGridIntervalX, mGridOffsetX, QgsComposerItem::mRotation, qgsDoubleNear(), and transformedMapPolygon().
Referenced by drawGrid(), and maxExtension().
| void QgsComposerMap::zoomContent | ( | int | delta, |
| double | x, | ||
| double | y | ||
| ) | [virtual] |
Zoom content of map.
| delta | value from wheel event that describes magnitude and direction (positive /negative number) |
| x | x-coordinate of mouse position in item coordinates |
| y | y-coordinate of mouse position in item coordinates |
Reimplemented from QgsComposerItem.
Definition at line 454 of file qgscomposermap.cpp.
References cache(), extentChanged(), QgsComposerItem::itemChanged(), mDrawing, mExtent, QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
double QgsComposerMap::mAnnotationFrameDistance [private] |
Distance between map frame and annotation.
Definition at line 451 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), maxExtension(), readXML(), and writeXML().
Annotation direction on bottom side ( horizontal or vertical )
Definition at line 460 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
Annotation position for bottom map side (inside / outside / not shown)
Definition at line 448 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
QImage QgsComposerMap::mCacheImage [private] |
Definition at line 378 of file qgscomposermap.h.
bool QgsComposerMap::mCacheUpdated [private] |
Definition at line 381 of file qgscomposermap.h.
Referenced by cache(), QgsComposerMap(), readXML(), setCacheUpdated(), setNewScale(), setSceneRect(), updateCachedImage(), and updateItem().
double QgsComposerMap::mCrossLength [private] |
The length of the cross sides for mGridStyle Cross.
Definition at line 470 of file qgscomposermap.h.
Referenced by drawGrid(), readXML(), and writeXML().
QRectF QgsComposerMap::mCurrentRectangle [private] |
Current bounding rectangle.
This is used to check if notification to the graphics scene is necessary
Definition at line 468 of file qgscomposermap.h.
Referenced by boundingRect(), QgsComposerMap(), and updateBoundingRect().
bool QgsComposerMap::mDrawCanvasItems [private] |
True if annotation items, rubber band, etc.
from the main canvas should be displayed
Definition at line 473 of file qgscomposermap.h.
Referenced by drawCanvasItems(), readXML(), and writeXML().
bool QgsComposerMap::mDrawing [private] |
set to true if in state of drawing.
Concurrent requests to draw method are returned if set to true
Definition at line 390 of file qgscomposermap.h.
Referenced by cache(), moveContent(), paint(), QgsComposerMap(), readXML(), and zoomContent().
QgsRectangle QgsComposerMap::mExtent [private] |
Definition at line 375 of file qgscomposermap.h.
Referenced by cache(), composerMapPosForItem(), drawCanvasItem(), mapPolygon(), mapUnitsToMM(), moveContent(), paint(), QgsComposerMap(), readXML(), requestedExtent(), scale(), setNewExtent(), setNewScale(), setSceneRect(), transformedExtent(), writeXML(), and zoomContent().
QFont QgsComposerMap::mGridAnnotationFont [private] |
Font for grid line annotation.
Definition at line 431 of file qgscomposermap.h.
Referenced by drawAnnotation(), drawCoordinateAnnotation(), maxExtension(), readXML(), and writeXML().
QColor QgsComposerMap::mGridAnnotationFontColor [private] |
Font color for grid line annotation.
Definition at line 433 of file qgscomposermap.h.
Referenced by drawAnnotation(), readXML(), and writeXML().
Definition at line 462 of file qgscomposermap.h.
Referenced by gridAnnotationString(), initGridAnnotationFormatFromProject(), readXML(), and writeXML().
int QgsComposerMap::mGridAnnotationPrecision [private] |
Digits after the dot.
Definition at line 435 of file qgscomposermap.h.
Referenced by gridAnnotationString(), readXML(), and writeXML().
QPainter::CompositionMode QgsComposerMap::mGridBlendMode [private] |
Blend mode for grid.
Definition at line 439 of file qgscomposermap.h.
Referenced by drawGrid(), setGridBlendMode(), and writeXML().
bool QgsComposerMap::mGridEnabled [private] |
True if coordinate grid has to be displayed.
Definition at line 419 of file qgscomposermap.h.
Referenced by maxExtension(), paint(), readXML(), and writeXML().
Definition at line 464 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), drawGrid(), maxExtension(), readXML(), and writeXML().
double QgsComposerMap::mGridFrameWidth [private] |
Definition at line 465 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), drawGridFrameBorder(), maxExtension(), readXML(), and writeXML().
double QgsComposerMap::mGridIntervalX [private] |
Grid line interval in x-direction (map units)
Definition at line 423 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and yGridLines().
double QgsComposerMap::mGridIntervalY [private] |
Grid line interval in y-direction (map units)
Definition at line 425 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and xGridLines().
QgsLineSymbolV2* QgsComposerMap::mGridLineSymbol [private] |
Definition at line 407 of file qgscomposermap.h.
Referenced by createDefaultGridLineSymbol(), drawGridLine(), gridPen(), QgsComposerMap(), readXML(), setGridLineSymbol(), setGridPenColor(), setGridPenWidth(), writeXML(), and ~QgsComposerMap().
double QgsComposerMap::mGridOffsetX [private] |
Grid line offset in x-direction.
Definition at line 427 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and yGridLines().
double QgsComposerMap::mGridOffsetY [private] |
Grid line offset in y-direction.
Definition at line 429 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and xGridLines().
GridStyle QgsComposerMap::mGridStyle [private] |
Solid or crosses.
Definition at line 421 of file qgscomposermap.h.
Referenced by drawGrid(), readXML(), and writeXML().
int QgsComposerMap::mId [private] |
Unique identifier.
Reimplemented from QgsComposerItem.
Definition at line 370 of file qgscomposermap.h.
Referenced by assignFreeId(), QgsComposerMap(), readXML(), and writeXML().
bool QgsComposerMap::mKeepLayerSet [private] |
Flag if layers to be displayed should be read from qgis canvas (true) or from stored list in mLayerSet (false)
Definition at line 398 of file qgscomposermap.h.
Referenced by draw(), readXML(), syncLayerSet(), and writeXML().
QStringList QgsComposerMap::mLayerSet [private] |
Stored layer list (used if layer live-link mKeepLayerSet is disabled)
Definition at line 401 of file qgscomposermap.h.
Referenced by draw(), readXML(), storeCurrentLayerSet(), syncLayerSet(), and writeXML().
Annotation direction on left side ( horizontal or vertical )
Definition at line 454 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
Annotation position for left map side (inside / outside / not shown)
Definition at line 442 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
QGraphicsView* QgsComposerMap::mMapCanvas [private] |
Definition at line 471 of file qgscomposermap.h.
Referenced by composerMapPosForItem(), drawCanvasItem(), and drawCanvasItems().
QgsMapRenderer* QgsComposerMap::mMapRenderer [private] |
Definition at line 367 of file qgscomposermap.h.
Referenced by composerMapPosForItem(), containsAdvancedEffects(), containsWMSLayer(), draw(), drawCanvasItem(), initGridAnnotationFormatFromProject(), QgsComposerMap(), scale(), storeCurrentLayerSet(), and syncLayerSet().
int QgsComposerMap::mNumCachedLayers [private] |
Number of layers when cache was created.
Definition at line 387 of file qgscomposermap.h.
Referenced by readXML().
QPainter::CompositionMode QgsComposerMap::mOverviewBlendMode [private] |
Blend mode for overview.
Definition at line 409 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), setOverviewBlendMode(), and writeXML().
int QgsComposerMap::mOverviewFrameMapId [private] |
Id of map which displays its extent rectangle into this composer map (overview map functionality).
-1 if not present
Definition at line 404 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), paint(), setOverviewFrameMap(), and writeXML().
Drawing style for overview farme.
Definition at line 406 of file qgscomposermap.h.
Referenced by createDefaultOverviewFrameSymbol(), drawOverviewMapExtent(), QgsComposerMap(), readXML(), setOverviewFrameMapSymbol(), writeXML(), and ~QgsComposerMap().
bool QgsComposerMap::mOverviewInverted [private] |
Definition at line 410 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), setOverviewInverted(), and writeXML().
PreviewMode QgsComposerMap::mPreviewMode [private] |
Preview style.
Definition at line 384 of file qgscomposermap.h.
Referenced by cache(), drawGridLine(), drawOverviewMapExtent(), paint(), QgsComposerMap(), readXML(), renderModeUpdateCachedImage(), setPreviewMode(), updateItem(), and writeXML().
Annotation direction on right side ( horizontal or vertical )
Definition at line 456 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
Annotation position for right map side (inside / outside / not shown)
Definition at line 444 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
bool QgsComposerMap::mShowGridAnnotation [private] |
True if coordinate values should be drawn.
Definition at line 437 of file qgscomposermap.h.
Referenced by drawGrid(), maxExtension(), readXML(), and writeXML().
Annotation direction on top side ( horizontal or vertical )
Definition at line 458 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
Annotation position for top map side (inside / outside / not shown)
Definition at line 446 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
double QgsComposerMap::mXOffset [private] |
Offset in x direction for showing map cache image.
Definition at line 393 of file qgscomposermap.h.
Referenced by paint(), QgsComposerMap(), setOffset(), transformedExtent(), and transformedMapPolygon().
double QgsComposerMap::mYOffset [private] |
Offset in y direction for showing map cache image.
Definition at line 395 of file qgscomposermap.h.
Referenced by paint(), QgsComposerMap(), setOffset(), transformedExtent(), and transformedMapPolygon().