QGIS API Documentation
2.4.0-Chugiak
|
Object representing map window. More...
#include <qgscomposermap.h>
Public Slots | |
void | updateCachedImage () |
Called if map canvas has changed. More... | |
void | renderModeUpdateCachedImage () |
Call updateCachedImage if item is in render mode. More... | |
void | overviewExtentChanged () |
Public Slots inherited from QgsComposerItem | |
virtual void | setItemRotation (double r, bool adjustPosition=false) |
Sets the item rotation. More... | |
void | repaint () |
Signals | |
void | extentChanged () |
void | mapRotationChanged (double newRotation) |
Is emitted on rotation change to notify north arrow pictures. More... | |
void | preparedForAtlas () |
Is emitted when the map has been prepared for atlas rendering, just before actual rendering. More... | |
Signals inherited from QgsComposerItem | |
void | itemRotationChanged (double newRotation) |
Is emitted on item rotation change. More... | |
void | itemChanged () |
Used e.g. More... | |
void | sizeChanged () |
Emitted if the rectangle changes. More... | |
void | frameChanged () |
Emitted if the item's frame style changes. More... | |
Public Member Functions | |
QgsComposerMap (QgsComposition *composition, int x, int y, int width, int height) | |
Constructor. More... | |
QgsComposerMap (QgsComposition *composition) | |
Constructor. More... | |
virtual | ~QgsComposerMap () |
virtual int | type () const |
return correct graphics item type. More... | |
void | draw (QPainter *painter, const QgsRectangle &extent, const QSizeF &size, double dpi, double *forceWidthScale=0) |
Draw to paint device. More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) |
Reimplementation of QCanvasItem::paint - draw on canvas. More... | |
void | cache () |
Create cache image. More... | |
int | id () const |
Get identification number. More... | |
bool | isDrawing () const |
True if a draw is already in progress. More... | |
void | resize (double dx, double dy) |
resizes an item in x- and y direction (canvas coordinates) More... | |
void | moveContent (double dx, double dy) |
Move content of map. More... | |
void | zoomContent (int delta, double x, double y) |
Zoom content of map. More... | |
void | setSceneRect (const QRectF &rectangle) |
Sets new scene rectangle bounds and recalculates hight and extent. More... | |
double | scale () const |
Scale. More... | |
void | setNewScale (double scaleDenominator) |
Sets new scale and changes only mExtent. More... | |
void | setNewExtent (const QgsRectangle &extent) |
Sets new Extent and changes width, height (and implicitely also scale) More... | |
void | setNewAtlasFeatureExtent (const QgsRectangle &extent) |
Sets new Extent for the current atlas preview and changes width, height (and implicitely also scale). More... | |
void | toggleAtlasPreview () |
Called when atlas preview is toggled, to force map item to update its extent and redraw. More... | |
QgsRectangle * | currentMapExtent () |
Returns a pointer to the current map extent, which is either the original user specified extent or the temporary atlas-driven feature extent depending on the current atlas state of the composition. More... | |
const QgsRectangle * | currentMapExtent () const |
PreviewMode | previewMode () const |
void | setPreviewMode (PreviewMode m) |
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. More... | |
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. More... | |
QStringList | layerSet () const |
Getter for stored layer set that is used if mKeepLayerSet is true. More... | |
void | setLayerSet (const QStringList &layerSet) |
Setter for stored layer set that is used if mKeepLayerSet is true. More... | |
void | storeCurrentLayerSet () |
Stores the current layer set of the qgis mapcanvas in mLayerSet. More... | |
void | setCacheUpdated (bool u=false) |
QgsRectangle | extent () const |
Q_DECL_DEPRECATED const QgsMapRenderer * | mapRenderer () const |
void | setOffset (double xOffset, double yOffset) |
Sets offset values to shift image (useful for live updates when moving item content) More... | |
bool | containsWMSLayer () const |
True if composer map renders a WMS layer. More... | |
bool | containsAdvancedEffects () const |
True if composer map contains layers with blend modes or flattened layers for vectors. More... | |
bool | writeXML (QDomElement &elem, QDomDocument &doc) const |
stores state in Dom node More... | |
bool | readXML (const QDomElement &itemElem, const QDomDocument &doc) |
sets state from Dom document More... | |
void | setGridEnabled (bool enabled) |
Enables a coordinate grid that is shown on top of this composermap. More... | |
bool | gridEnabled () const |
void | setGridStyle (GridStyle style) |
Sets coordinate grid style to solid or cross. More... | |
GridStyle | gridStyle () const |
void | setGridIntervalX (double interval) |
Sets coordinate interval in x-direction for composergrid. More... | |
double | gridIntervalX () const |
void | setGridIntervalY (double interval) |
Sets coordinate interval in y-direction for composergrid. More... | |
double | gridIntervalY () const |
void | setGridOffsetX (double offset) |
Sets x-coordinate offset for composer grid. More... | |
double | gridOffsetX () const |
void | setGridOffsetY (double offset) |
Sets y-coordinate offset for composer grid. More... | |
double | gridOffsetY () const |
void | setGridPen (const QPen &p) |
Sets the pen to draw composer grid. More... | |
QPen | gridPen () const |
void | setGridPenWidth (double w) |
Sets with of grid pen. More... | |
void | setGridPenColor (const QColor &c) |
Sets the color of the grid pen. More... | |
void | setGridAnnotationFont (const QFont &f) |
Sets font for grid annotations. More... | |
QFont | gridAnnotationFont () const |
void | setAnnotationFontColor (const QColor &c) |
Sets font color for grid annotations. More... | |
QColor | annotationFontColor () const |
Get font color for grid annotations. More... | |
void | setGridAnnotationPrecision (int p) |
Sets coordinate precision for grid annotations. More... | |
int | gridAnnotationPrecision () const |
void | setShowGridAnnotation (bool show) |
Sets flag if grid annotation should be shown. More... | |
bool | showGridAnnotation () const |
void | setGridAnnotationPosition (GridAnnotationPosition p, QgsComposerMap::Border border) |
GridAnnotationPosition | gridAnnotationPosition (QgsComposerMap::Border border) const |
void | setAnnotationFrameDistance (double d) |
Sets distance between map frame and annotations. More... | |
double | annotationFrameDistance () const |
void | setGridAnnotationDirection (GridAnnotationDirection d, QgsComposerMap::Border border) |
GridAnnotationDirection | gridAnnotationDirection (QgsComposerMap::Border border) const |
void | setGridAnnotationFormat (GridAnnotationFormat f) |
GridAnnotationFormat | gridAnnotationFormat () const |
void | setGridFrameStyle (GridFrameStyle style) |
Set grid frame style (NoGridFrame or Zebra) More... | |
GridFrameStyle | gridFrameStyle () const |
void | setGridFrameWidth (double w) |
Set grid frame width. More... | |
double | gridFrameWidth () const |
void | setGridFramePenSize (double w) |
Set grid frame pen thickness. More... | |
double | gridFramePenSize () const |
void | setGridFramePenColor (const QColor &c) |
Sets pen color for grid frame. More... | |
QColor | gridFramePenColor () const |
Get pen color for grid frame. More... | |
void | setGridFrameFillColor1 (const QColor &c) |
Sets first fill color for grid zebra frame. More... | |
QColor | gridFrameFillColor1 () const |
Get first fill color for grid zebra frame. More... | |
void | setGridFrameFillColor2 (const QColor &c) |
Sets second fill color for grid zebra frame. More... | |
QColor | gridFrameFillColor2 () const |
Get second fill color for grid zebra frame. More... | |
QRectF | boundingRect () const |
In case of annotations, the bounding rectangle can be larger than the map item rectangle. More... | |
void | updateBoundingRect () |
Updates the bounding rect of this item. More... | |
virtual void | setFrameOutlineWidth (double outlineWidth) |
Sets frame outline width. More... | |
void | setCrossLength (double l) |
Sets length of the cros segments (if grid style is cross) More... | |
double | crossLength () |
Q_DECL_DEPRECATED void | setRotation (double r) |
Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item. More... | |
Q_DECL_DEPRECATED double | rotation () const |
Returns the rotation used for drawing the map within the composer item. More... | |
void | setMapRotation (double r) |
Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item. More... | |
double | mapRotation () const |
Returns the rotation used for drawing the map within the composer item. More... | |
void | updateItem () |
Updates item, with the possibility to do custom update for subclasses. More... | |
void | setMapCanvas (QGraphicsView *canvas) |
Sets canvas pointer (necessary to query and draw map canvas items) More... | |
void | setDrawCanvasItems (bool b) |
bool | drawCanvasItems () const |
double | mapUnitsToMM () const |
Returns the conversion factor map units -> mm. More... | |
void | setOverviewFrameMap (int mapId) |
Sets overview frame map. More... | |
int | overviewFrameMapId () const |
Returns id of overview frame (or -1 if no overfiew frame) More... | |
void | setOverviewFrameMapSymbol (QgsFillSymbolV2 *symbol) |
QgsFillSymbolV2 * | overviewFrameMapSymbol () |
QPainter::CompositionMode | overviewBlendMode () const |
Returns the overview's blending mode. More... | |
void | setOverviewBlendMode (QPainter::CompositionMode blendMode) |
Sets the overview's blending mode. More... | |
bool | overviewInverted () const |
Returns true if the overview frame is inverted. More... | |
void | setOverviewInverted (bool inverted) |
Sets the overview's inversion mode. More... | |
bool | overviewCentered () const |
Returns true if the extent is forced to center on the overview. More... | |
void | setOverviewCentered (bool centered) |
Set the overview's centering mode. More... | |
void | setGridLineSymbol (QgsLineSymbolV2 *symbol) |
QgsLineSymbolV2 * | gridLineSymbol () |
QPainter::CompositionMode | gridBlendMode () const |
Returns the grid's blending mode. More... | |
void | setGridBlendMode (QPainter::CompositionMode blendMode) |
Sets the grid's blending mode. More... | |
void | assignFreeId () |
Sets mId to a number not yet used in the composition. More... | |
Q_DECL_DEPRECATED bool | imageSizeConsideringRotation (double &width, double &height) const |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. More... | |
Q_DECL_DEPRECATED bool | cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height) const |
Calculates corner point after rotation and scaling. More... | |
Q_DECL_DEPRECATED void | sizeChangedByRotation (double &width, double &height) |
Calculates width / height of the bounding box of a rotated rectangle. More... | |
bool | atlasDriven () const |
Returns whether the map extent is set to follow the current atlas feature. More... | |
void | setAtlasDriven (bool enabled) |
Sets whether the map extent will follow the current atlas feature. More... | |
Q_DECL_DEPRECATED bool | atlasFixedScale () const |
Returns true if the map uses a fixed scale when in atlas mode. More... | |
Q_DECL_DEPRECATED void | setAtlasFixedScale (bool fixed) |
Set to true if the map should use a fixed scale when in atlas mode. More... | |
AtlasScalingMode | atlasScalingMode () const |
Returns the current atlas scaling mode. More... | |
void | setAtlasScalingMode (AtlasScalingMode mode) |
Sets the current atlas scaling mode. More... | |
double | atlasMargin () const |
Returns the margin size (percentage) used when the map is in atlas mode. More... | |
void | setAtlasMargin (double margin) |
Sets the margin size (percentage) used when the map is in atlas mode. More... | |
void | setUpdatesEnabled (bool enabled) |
Sets whether updates to the composer map are enabled. More... | |
bool | updatesEnabled () const |
Returns whether updates to the composer map are enabled. More... | |
int | numberExportLayers () const |
Get the number of layers that this item requires for exporting as layers. More... | |
QPolygonF | visibleExtentPolygon () const |
Returns a polygon representing the current visible map extent, considering map extents and rotation. More... | |
Public Member Functions inherited from QgsComposerItem | |
QgsComposerItem (QgsComposition *composition, bool manageZValue=true) | |
Constructor. More... | |
QgsComposerItem (qreal x, qreal y, qreal width, qreal height, QgsComposition *composition, bool manageZValue=true) | |
Constructor with box position and composer object. More... | |
virtual | ~QgsComposerItem () |
virtual void | setSelected (bool s) |
Set selected, selected item should be highlighted. More... | |
virtual bool | selected () const |
Is selected. More... | |
virtual bool | writeSettings () |
stores state in project More... | |
virtual bool | readSettings () |
read state from project More... | |
virtual bool | removeSettings () |
delete settings from project file More... | |
void | move (double dx, double dy) |
Moves item in canvas coordinates. More... | |
int | page () const |
Gets the page the item is currently on. More... | |
QPointF | pagePos () const |
Returns the item's position relative to its current page. More... | |
void | updatePagePos (double newPageWidth, double newPageHeight) |
Moves the item so that it retains its relative position on the page when the paper size changes. More... | |
void | setItemPosition (double x, double y, ItemPositionMode itemPoint=UpperLeft, int page=-1) |
Moves the item to a new position (in canvas coordinates) More... | |
void | setItemPosition (double x, double y, double width, double height, ItemPositionMode itemPoint=UpperLeft, bool posIncludesFrame=false, int page=-1) |
Sets item position and width / height in one go. More... | |
ItemPositionMode | lastUsedPositionMode () |
Returns item's last used position mode. More... | |
bool | _writeXML (QDomElement &itemElem, QDomDocument &doc) const |
Writes parameter that are not subclass specific in document. More... | |
bool | _readXML (const QDomElement &itemElem, const QDomDocument &doc) |
Reads parameter that are not subclass specific in document. More... | |
bool | hasFrame () const |
Whether this item has a frame or not. More... | |
void | setFrameEnabled (bool drawFrame) |
Set whether this item has a frame drawn around it or not. More... | |
double | frameOutlineWidth () const |
Returns the frame's outline width. More... | |
Qt::PenJoinStyle | frameJoinStyle () const |
Returns the join style used for drawing the item's frame. More... | |
void | setFrameJoinStyle (Qt::PenJoinStyle style) |
Sets join style used when drawing the item's frame. More... | |
virtual double | estimatedFrameBleed () const |
Returns the estimated amount the item's frame bleeds outside the item's actual rectangle. More... | |
virtual QRectF | rectWithFrame () const |
Returns the item's rectangular bounds, including any bleed caused by the item's frame. More... | |
bool | hasBackground () const |
Whether this item has a Background or not. More... | |
void | setBackgroundEnabled (bool drawBackground) |
Set whether this item has a Background drawn around it or not. More... | |
QColor | backgroundColor () const |
Gets the background color for this item. More... | |
void | setBackgroundColor (const QColor &backgroundColor) |
Sets the background color for this item. More... | |
QPainter::CompositionMode | blendMode () const |
Returns the item's composition blending mode. More... | |
void | setBlendMode (QPainter::CompositionMode blendMode) |
Sets the item's composition blending mode. More... | |
int | transparency () const |
Returns the item's transparency. More... | |
void | setTransparency (int transparency) |
Sets the item's transparency. More... | |
bool | effectsEnabled () const |
Returns true if effects (eg blend modes) are enabled for the item. More... | |
void | setEffectsEnabled (bool effectsEnabled) |
Sets whether effects (eg blend modes) are enabled for the item. More... | |
virtual void | addItem (QgsComposerItem *item) |
Composite operations for item groups do nothing per default. More... | |
virtual void | removeItems () |
const QgsComposition * | composition () const |
QgsComposition * | composition () |
virtual void | beginItemCommand (const QString &text) |
void | beginCommand (const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown) |
Starts new composer undo command. More... | |
virtual void | endItemCommand () |
void | endCommand () |
Finish current command and push it onto the undo stack. More... | |
void | cancelCommand () |
void | drawText (QPainter *p, double x, double y, const QString &text, const QFont &font) const |
Draws Text. More... | |
void | drawText (QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignment=Qt::AlignLeft, Qt::AlignmentFlag valignment=Qt::AlignTop, int flags=Qt::TextWordWrap) const |
Like the above, but with a rectangle for multiline text. More... | |
double | textWidthMillimeters (const QFont &font, const QString &text) const |
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More... | |
double | fontHeightCharacterMM (const QFont &font, const QChar &c) const |
Returns the font height of a character in millimeters. More... | |
double | fontAscentMillimeters (const QFont &font) const |
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More... | |
double | fontDescentMillimeters (const QFont &font) const |
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More... | |
double | fontHeightMillimeters (const QFont &font) const |
Returns the font height in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE. More... | |
double | pixelFontSize (double pointSize) const |
Calculates font to from point size to pixel size. More... | |
QFont | scaledFontPixelSize (const QFont &font) const |
Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE. More... | |
void | setPositionLock (bool lock) |
Locks / unlocks the item position for mouse drags. More... | |
bool | positionLock () const |
Returns position lock for mouse drags (true means locked) More... | |
double | itemRotation () const |
Returns the rotation for the composer item. More... | |
Q_DECL_DEPRECATED double | rotation () const |
Returns the rotation for the composer item. More... | |
QString | id () const |
Get item's id (which is not necessarly unique) More... | |
virtual void | setId (const QString &id) |
Set item's id (which is not necessarly unique) More... | |
QString | uuid () const |
Get item identification name. More... | |
virtual void | setCurrentExportLayer (int layerIdx=-1) |
Sets the current layer to draw for exporting. More... | |
Private Types | |
enum | AnnotationCoordinate { Longitude = 0, Latitude } |
enum | PartType { Background, Layer, Grid, OverviewMapExtent, Frame, SelectionBoxes } |
Private Member Functions | |
void | connectUpdateSlot () |
Establishes signal/slot connection for update in case of layer change. More... | |
void | syncLayerSet () |
Removes layer ids from mLayerSet that are no longer present in the qgis main map. More... | |
void | adjustExtentToItemShape (double itemWidth, double itemHeight, QgsRectangle &extent) const |
Adjusts an extent rectangle to match the provided item width and height, so that extent center of extent remains the same. More... | |
QStringList | layersToRender () const |
Returns a list of the layers to render for this map item. More... | |
void | drawGrid (QPainter *p) |
Draws the map grid. More... | |
void | drawGridFrame (QPainter *p, const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines) |
void | drawCoordinateAnnotations (QPainter *p, const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines) |
Draw coordinates for mGridAnnotationType Coordinate. More... | |
void | drawCoordinateAnnotation (QPainter *p, const QPointF &pos, QString annotationString) |
void | drawAnnotation (QPainter *p, const QPointF &pos, int rotation, const QString &annotationText) |
Draws a single annotation. More... | |
QString | gridAnnotationString (double value, AnnotationCoordinate coord) const |
int | xGridLines (QList< QPair< double, QLineF > > &lines) const |
Returns the grid lines with associated coordinate value. More... | |
int | yGridLines (QList< QPair< double, QLineF > > &lines) const |
Returns the grid lines for the y-coordinates. More... | |
QgsRectangle | transformedExtent () const |
Returns extent that considers mOffsetX / mOffsetY (during content move) More... | |
QPolygonF | transformedMapPolygon () const |
Returns extent that considers rotation and shift with mOffsetX / mOffsetY. More... | |
double | maxExtension () const |
void | mapPolygon (const QgsRectangle &extent, QPolygonF &poly) const |
mapPolygon variant using a given extent More... | |
void | requestedExtent (QgsRectangle &extent) const |
Calculates the extent to request and the yShift of the top-left point in case of rotation. More... | |
void | transformShift (double &xShift, double &yShift) const |
Scales a composer map shift (in MM) and rotates it by mRotation. More... | |
QPointF | mapToItemCoords (const QPointF &mapCoords) const |
Transforms map coordinates to item coordinates (considering rotation and move offset) More... | |
Border | borderForLineCoord (const QPointF &p) const |
Returns the item border of a point (in item coordinates) More... | |
void | drawCanvasItems (QPainter *painter, const QStyleOptionGraphicsItem *itemStyle) |
void | drawCanvasItem (QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *itemStyle) |
QPointF | composerMapPosForItem (const QGraphicsItem *item) const |
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 | drawGridFrameBorder (QPainter *p, const QMap< double, double > &borderPos, Border border) |
void | drawGridLine (const QLineF &line, QgsRenderContext &context) |
void | drawOverviewMapExtent (QPainter *p) |
void | createDefaultOverviewFrameSymbol () |
void | createDefaultGridLineSymbol () |
void | initGridAnnotationFormatFromProject () |
bool | shouldDrawPart (PartType part) const |
Test if a part of the copmosermap needs to be drawn, considering mCurrentExportLayer. More... | |
Private Attributes | |
int | mId |
Unique identifier. More... | |
QgsRectangle | mExtent |
QgsRectangle | mAtlasFeatureExtent |
QImage | mCacheImage |
bool | mCacheUpdated |
PreviewMode | mPreviewMode |
Preview style. More... | |
int | mNumCachedLayers |
Number of layers when cache was created. More... | |
bool | mDrawing |
set to true if in state of drawing. More... | |
double | mXOffset |
Offset in x direction for showing map cache image. More... | |
double | mYOffset |
Offset in y direction for showing map cache image. More... | |
double | mMapRotation |
Map rotation. More... | |
bool | mKeepLayerSet |
Flag if layers to be displayed should be read from qgis canvas (true) or from stored list in mLayerSet (false) More... | |
QStringList | mLayerSet |
Stored layer list (used if layer live-link mKeepLayerSet is disabled) More... | |
int | mOverviewFrameMapId |
Id of map which displays its extent rectangle into this composer map (overview map functionality). More... | |
QgsFillSymbolV2 * | mOverviewFrameMapSymbol |
Drawing style for overview farme. More... | |
QgsLineSymbolV2 * | mGridLineSymbol |
QPainter::CompositionMode | mOverviewBlendMode |
Blend mode for overview. More... | |
bool | mOverviewInverted |
bool | mOverviewCentered |
Centering mode for overview. More... | |
bool | mUpdatesEnabled |
Whether updates to the map are enabled. More... | |
bool | mGridEnabled |
True if coordinate grid has to be displayed. More... | |
GridStyle | mGridStyle |
Solid or crosses. More... | |
double | mGridIntervalX |
Grid line interval in x-direction (map units) More... | |
double | mGridIntervalY |
Grid line interval in y-direction (map units) More... | |
double | mGridOffsetX |
Grid line offset in x-direction. More... | |
double | mGridOffsetY |
Grid line offset in y-direction. More... | |
QFont | mGridAnnotationFont |
Font for grid line annotation. More... | |
QColor | mGridAnnotationFontColor |
Font color for grid line annotation. More... | |
int | mGridAnnotationPrecision |
Digits after the dot. More... | |
bool | mShowGridAnnotation |
True if coordinate values should be drawn. More... | |
QPainter::CompositionMode | mGridBlendMode |
Blend mode for grid. More... | |
GridAnnotationPosition | mLeftGridAnnotationPosition |
Annotation position for left map side (inside / outside / not shown) More... | |
GridAnnotationPosition | mRightGridAnnotationPosition |
Annotation position for right map side (inside / outside / not shown) More... | |
GridAnnotationPosition | mTopGridAnnotationPosition |
Annotation position for top map side (inside / outside / not shown) More... | |
GridAnnotationPosition | mBottomGridAnnotationPosition |
Annotation position for bottom map side (inside / outside / not shown) More... | |
double | mAnnotationFrameDistance |
Distance between map frame and annotation. More... | |
GridAnnotationDirection | mLeftGridAnnotationDirection |
Annotation direction on left side ( horizontal or vertical ) More... | |
GridAnnotationDirection | mRightGridAnnotationDirection |
Annotation direction on right side ( horizontal or vertical ) More... | |
GridAnnotationDirection | mTopGridAnnotationDirection |
Annotation direction on top side ( horizontal or vertical ) More... | |
GridAnnotationDirection | mBottomGridAnnotationDirection |
Annotation direction on bottom side ( horizontal or vertical ) More... | |
GridAnnotationFormat | mGridAnnotationFormat |
GridFrameStyle | mGridFrameStyle |
double | mGridFrameWidth |
double | mGridFramePenThickness |
QColor | mGridFramePenColor |
QColor | mGridFrameFillColor1 |
QColor | mGridFrameFillColor2 |
QRectF | mCurrentRectangle |
Current bounding rectangle. More... | |
double | mCrossLength |
The length of the cross sides for mGridStyle Cross. More... | |
QGraphicsView * | mMapCanvas |
bool | mDrawCanvasItems |
True if annotation items, rubber band, etc. More... | |
bool | mAtlasDriven |
True if map is being controlled by an atlas. More... | |
AtlasScalingMode | mAtlasScalingMode |
Current atlas scaling mode. More... | |
double | mAtlasMargin |
Margin size for atlas driven extents (percentage of feature size) - when in auto scaling mode. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QgsComposerItem | |
virtual void | drawSelectionBoxes (QPainter *p) |
Draw selection boxes around item. More... | |
virtual void | drawFrame (QPainter *p) |
Draw black frame around item. More... | |
virtual void | drawBackground (QPainter *p) |
Draw background. More... | |
void | drawArrowHead (QPainter *p, double x, double y, double angle, double arrowHeadWidth) const |
Draws arrowhead. More... | |
double | angle (const QPointF &p1, const QPointF &p2) const |
Returns angle of the line from p1 to p2 (clockwise, starting at N) More... | |
double | rectHandlerBorderTolerance () const |
Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to the item border for resizing. More... | |
double | lockSymbolSize () const |
Returns the size of the lock symbol depending on the composer zoom level and the item size. More... | |
double | horizontalViewScaleFactor () const |
Returns the zoom factor of the graphics view. More... | |
bool | imageSizeConsideringRotation (double &width, double &height, double rotation) const |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. More... | |
Q_DECL_DEPRECATED bool | imageSizeConsideringRotation (double &width, double &height) const |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation. More... | |
QRectF | largestRotatedRectWithinBounds (QRectF originalRect, QRectF boundsRect, double rotation) const |
Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by a specified amount. More... | |
bool | cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height, double rotation) const |
Calculates corner point after rotation and scaling. More... | |
Q_DECL_DEPRECATED bool | cornerPointOnRotatedAndScaledRect (double &x, double &y, double width, double height) const |
Calculates corner point after rotation and scaling. More... | |
void | sizeChangedByRotation (double &width, double &height, double rotation) |
Calculates width / height of the bounding box of a rotated rectangle. More... | |
Q_DECL_DEPRECATED void | sizeChangedByRotation (double &width, double &height) |
Calculates width / height of the bounding box of a rotated rectangle. More... | |
void | rotate (double angle, double &x, double &y) const |
Rotates a point / vector. More... | |
QGraphicsLineItem * | hAlignSnapItem () |
Return horizontal align snap item. More... | |
void | deleteHAlignSnapItem () |
QGraphicsLineItem * | vAlignSnapItem () |
Return vertical align snap item. More... | |
void | deleteVAlignSnapItem () |
void | deleteAlignItems () |
Protected Attributes inherited from QgsComposerItem | |
QgsComposition * | mComposition |
QgsComposerItem::MouseMoveAction | mCurrentMouseMoveAction |
QPointF | mMouseMoveStartPos |
Start point of the last mouse move action (in scene coordinates) More... | |
QPointF | mLastMouseEventPos |
Position of the last mouse move event (in scene coordinates) More... | |
QGraphicsRectItem * | mBoundingResizeRectangle |
Rectangle used during move and resize actions. More... | |
QGraphicsLineItem * | mHAlignSnapItem |
QGraphicsLineItem * | mVAlignSnapItem |
bool | mFrame |
True if item fram needs to be painted. More... | |
bool | mBackground |
True if item background needs to be painted. More... | |
QColor | mBackgroundColor |
Background color. More... | |
Qt::PenJoinStyle | mFrameJoinStyle |
Frame join style. More... | |
bool | mItemPositionLocked |
True if item position and size cannot be changed with mouse move. More... | |
double | mLastValidViewScaleFactor |
Backup to restore item appearance if no view scale factor is available. More... | |
double | mItemRotation |
Item rotation in degrees, clockwise. More... | |
QPainter::CompositionMode | mBlendMode |
Composition blend mode for item. More... | |
bool | mEffectsEnabled |
QgsComposerEffect * | mEffect |
int | mTransparency |
Item transparency. More... | |
ItemPositionMode | mLastUsedPositionMode |
The item's position mode. More... | |
int | mCurrentExportLayer |
The layer that needs to be exported. More... | |
Object representing map window.
Definition at line 42 of file qgscomposermap.h.
|
private |
Enumerator | |
---|---|
Longitude | |
Latitude |
Definition at line 547 of file qgscomposermap.h.
Scaling modes used for the serial rendering (atlas)
Enumerator | |
---|---|
Fixed | |
Predefined | |
Auto |
Definition at line 109 of file qgscomposermap.h.
Enum for different frame borders.
Enumerator | |
---|---|
Left | |
Right | |
Bottom | |
Top |
Definition at line 99 of file qgscomposermap.h.
Enumerator | |
---|---|
Horizontal | |
Vertical | |
HorizontalAndVertical | |
BoundaryDirection |
Definition at line 77 of file qgscomposermap.h.
Enumerator | |
---|---|
Decimal | |
DegreeMinute | |
DegreeMinuteSecond |
Definition at line 85 of file qgscomposermap.h.
Enumerator | |
---|---|
InsideMapFrame | |
OutsideMapFrame | |
Disabled |
Definition at line 70 of file qgscomposermap.h.
Enumerator | |
---|---|
NoGridFrame | |
Zebra |
Definition at line 92 of file qgscomposermap.h.
Enumerator | |
---|---|
Solid | |
Cross |
Definition at line 64 of file qgscomposermap.h.
|
private |
Enumerator | |
---|---|
Background | |
Layer | |
Grid | |
OverviewMapExtent | |
Frame | |
SelectionBoxes |
Definition at line 744 of file qgscomposermap.h.
QgsComposerMap::QgsComposerMap | ( | QgsComposition * | composition, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Constructor.
Definition at line 44 of file qgscomposermap.cpp.
References assignFreeId(), QgsComposerItem::composition(), connectUpdateSlot(), createDefaultGridLineSymbol(), createDefaultOverviewFrameSymbol(), initGridAnnotationFormatFromProject(), QgsProject::instance(), QgsComposition::mapSettings(), mCacheUpdated, QgsComposerItem::mComposition, mCurrentRectangle, mDrawing, mExtent, mGridAnnotationFont, mGridLineSymbol, mId, mOverviewFrameMapSymbol, mPreviewMode, mXOffset, mYOffset, QgsProject::readNumEntry(), Rectangle, QgsComposerItem::setBackgroundColor(), setSceneRect(), tr, and QgsMapSettings::visibleExtent().
QgsComposerMap::QgsComposerMap | ( | QgsComposition * | composition | ) |
Constructor.
Settings are read from project.
Definition at line 102 of file qgscomposermap.cpp.
References QgsComposition::composerMapItems(), QgsComposerItem::composition(), connectUpdateSlot(), createDefaultOverviewFrameSymbol(), initGridAnnotationFormatFromProject(), QgsComposerItem::mComposition, mCurrentRectangle, mGridLineSymbol, mId, mOverviewFrameMapSymbol, mPreviewMode, mXOffset, mYOffset, Rectangle, and tr.
|
virtual |
Definition at line 158 of file qgscomposermap.cpp.
References mGridLineSymbol, and mOverviewFrameMapSymbol.
|
private |
Adjusts an extent rectangle to match the provided item width and height, so that extent center of extent remains the same.
Definition at line 135 of file qgscomposermap.cpp.
References QgsRectangle::height(), QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
|
inline |
Get font color for grid annotations.
Definition at line 287 of file qgscomposermap.h.
|
inline |
Definition at line 305 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 2677 of file qgscomposermap.cpp.
References QgsComposition::composerMapItems(), QgsComposition::getComposerMapById(), QgsComposerItem::mComposition, and mId.
Referenced by QgsComposition::addItemsFromXML(), and QgsComposerMap().
|
inline |
Returns whether the map extent is set to follow the current atlas feature.
Definition at line 451 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::composerMap(), QgsAtlasComposition::prepareForFeature(), QgsAtlasComposition::prepareMap(), QgsComposition::setAtlasMode(), and QgsAtlasComposition::updateAtlasMaps().
bool QgsComposerMap::atlasFixedScale | ( | ) | const |
Returns true if the map uses a fixed scale when in atlas mode.
Definition at line 2721 of file qgscomposermap.cpp.
References Fixed, and mAtlasScalingMode.
Referenced by QgsAtlasComposition::fixedScale().
|
inline |
Returns the margin size (percentage) used when the map is in atlas mode.
Definition at line 496 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::margin(), and QgsAtlasComposition::prepareMap().
|
inline |
Returns the current atlas scaling mode.
This controls how the map's extents are calculated for the current atlas feature when an atlas composition is enabled.
Definition at line 478 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::prepareMap().
|
private |
Returns the item border of a point (in item coordinates)
Definition at line 2317 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 2033 of file qgscomposermap.cpp.
References mCurrentRectangle.
void QgsComposerMap::cache | ( | void | ) |
Create cache image.
Definition at line 230 of file qgscomposermap.cpp.
References QgsComposerItem::backgroundColor(), draw(), QgsComposerItem::hasBackground(), QgsRectangle::height(), QgsComposerItem::horizontalViewScaleFactor(), mapUnitsToMM(), mCacheImage, mCacheUpdated, mDrawing, QgsComposerItem::mLastValidViewScaleFactor, mPreviewMode, Rectangle, requestedExtent(), and QgsRectangle::width().
Referenced by QgsComposition::addComposerMap(), moveContent(), overviewExtentChanged(), setNewScale(), QgsAtlasComposition::updateAtlasMaps(), updateCachedImage(), updateItem(), and zoomContent().
|
private |
Definition at line 2405 of file qgscomposermap.cpp.
References currentMapExtent(), QgsRectangle::height(), QgsComposition::mapSettings(), mapToItemCoords(), QgsComposerItem::mComposition, mMapCanvas, QgsMapSettings::visibleExtent(), QgsRectangle::width(), QgsRectangle::xMinimum(), and QgsRectangle::yMaximum().
Referenced by drawCanvasItem().
|
private |
Establishes signal/slot connection for update in case of layer change.
Definition at line 945 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 895 of file qgscomposermap.cpp.
References QgsMapLayer::blendMode(), QgsPalLayerSettings::blendMode, QgsPalLayerSettings::bufferBlendMode, QgsPalLayerSettings::bufferSize, QgsVectorLayer::featureBlendMode(), QgsPalLayerSettings::fromLayer(), QgsMapLayerRegistry::instance(), QgsMapSettings::layers(), QgsVectorLayer::layerTransparency(), QgsMapLayerRegistry::mapLayer(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, QgsPalLayerSettings::shadowBlendMode, QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::shapeBlendMode, QgsPalLayerSettings::shapeDraw, and QgsPalLabeling::staticWillUseLayer().
bool QgsComposerMap::containsWMSLayer | ( | ) | const |
True if composer map renders a WMS layer.
Definition at line 866 of file qgscomposermap.cpp.
References QgsRasterLayer::dataProvider(), QgsMapLayerRegistry::instance(), QgsMapSettings::layers(), QgsMapLayerRegistry::mapLayer(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, and QgsDataProvider::name().
bool QgsComposerMap::cornerPointOnRotatedAndScaledRect | ( | double & | x, |
double & | y, | ||
double | width, | ||
double | height | ||
) | const |
Calculates corner point after rotation and scaling.
Definition at line 2709 of file qgscomposermap.cpp.
References QgsComposerItem::cornerPointOnRotatedAndScaledRect(), and mMapRotation.
|
private |
Definition at line 2647 of file qgscomposermap.cpp.
References QgsLineSymbolV2::createSimple(), and mGridLineSymbol.
Referenced by QgsComposerMap().
|
private |
Definition at line 2636 of file qgscomposermap.cpp.
References QgsFillSymbolV2::createSimple(), mOverviewFrameMapSymbol, and QgsSymbolV2::setAlpha().
Referenced by QgsComposerMap().
|
inline |
Definition at line 362 of file qgscomposermap.h.
QgsRectangle * QgsComposerMap::currentMapExtent | ( | ) |
Returns a pointer to the current map extent, which is either the original user specified extent or the temporary atlas-driven feature extent depending on the current atlas state of the composition.
Both a const and non-const version are included.
Definition at line 763 of file qgscomposermap.cpp.
References QgsComposition::atlasMode(), QgsComposition::AtlasOff, mAtlasDriven, mAtlasFeatureExtent, QgsComposerItem::mComposition, and mExtent.
Referenced by composerMapPosForItem(), QgsComposition::computeWorldFileParameters(), drawGrid(), drawOverviewMapExtent(), QgsComposerAttributeTable::getFeatureAttributes(), mapUnitsToMM(), QgsComposerScaleBar::mapWidth(), moveContent(), overviewExtentChanged(), paint(), QgsComposerScaleBar::refreshSegmentMillimeters(), requestedExtent(), scale(), setNewScale(), transformedExtent(), visibleExtentPolygon(), and zoomContent().
const QgsRectangle * QgsComposerMap::currentMapExtent | ( | ) | const |
Definition at line 779 of file qgscomposermap.cpp.
References QgsComposition::atlasMode(), QgsComposition::AtlasOff, mAtlasDriven, mAtlasFeatureExtent, QgsComposerItem::mComposition, and mExtent.
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 166 of file qgscomposermap.cpp.
References QgsMapSettings::destinationCrs(), QgsMapSettings::DrawEditingInfo, QgsMapSettings::DrawSelection, QgsMapSettings::flags(), QgsMapSettings::ForceVectorOutput, QgsComposerItem::hasBackground(), QgsMapSettings::hasCrsTransformEnabled(), QgsComposerItem::id(), layersToRender(), QgsComposition::mapSettings(), QgsMapSettings::mapUnits(), QgsComposerItem::mComposition, QgsComposerItem::mCurrentExportLayer, QgsMapSettings::outputImageFormat(), QgsComposition::plotStyle(), QgsComposition::Postscript, QgsComposition::Print, QgsMapRendererCustomPainterJob::renderSynchronously(), QgsMapSettings::setBackgroundColor(), QgsMapSettings::setCrsTransformEnabled(), QgsMapSettings::setDestinationCrs(), QgsMapSettings::setExtent(), QgsMapSettings::setFlag(), QgsMapSettings::setFlags(), QgsMapSettings::setLayers(), QgsMapSettings::setMapUnits(), QgsMapSettings::setOutputDpi(), QgsMapSettings::setOutputImageFormat(), QgsMapSettings::setOutputSize(), QgsExpression::setSpecialColumn(), QgsMapSettings::UseAdvancedEffects, QgsComposition::useAdvancedEffects(), and QgsMapSettings::UseRenderingOptimization.
|
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 1812 of file qgscomposermap.cpp.
References QgsComposerItem::drawText(), mGridAnnotationFont, and mGridAnnotationFontColor.
Referenced by drawCoordinateAnnotation().
|
private |
Definition at line 2363 of file qgscomposermap.cpp.
References composerMapPosForItem(), and mMapCanvas.
Referenced by drawCanvasItems().
|
inline |
Definition at line 388 of file qgscomposermap.h.
Referenced by paint().
|
private |
Definition at line 2337 of file qgscomposermap.cpp.
References drawCanvasItem(), mDrawCanvasItems, and mMapCanvas.
|
private |
Definition at line 1654 of file qgscomposermap.cpp.
References borderForLineCoord(), Bottom, BoundaryDirection, drawAnnotation(), QgsComposerItem::fontHeightCharacterMM(), Horizontal, InsideMapFrame, Left, mAnnotationFrameDistance, mBottomGridAnnotationDirection, mBottomGridAnnotationPosition, mGridAnnotationFont, mGridFramePenThickness, mGridFrameStyle, mGridFrameWidth, mLeftGridAnnotationDirection, mLeftGridAnnotationPosition, mRightGridAnnotationDirection, mRightGridAnnotationPosition, mTopGridAnnotationDirection, mTopGridAnnotationPosition, NoGridFrame, OutsideMapFrame, Right, rotation(), QgsComposerItem::textWidthMillimeters(), and Vertical.
Referenced by drawCoordinateAnnotations().
|
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 1628 of file qgscomposermap.cpp.
References drawCoordinateAnnotation(), gridAnnotationString(), Latitude, and Longitude.
Referenced by drawGrid().
|
private |
Draws the map grid.
Definition at line 1424 of file qgscomposermap.cpp.
References currentMapExtent(), drawCoordinateAnnotations(), drawGridFrame(), drawGridLine(), QgsRenderContext::fromMapSettings(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, mCrossLength, mGridBlendMode, mGridFrameStyle, mGridStyle, mShowGridAnnotation, NoGridFrame, QgsSymbolLayerV2Utils::pointOnLineWithDistance(), QgsMapSettings::setExtent(), QgsRenderContext::setForceVectorOutput(), QgsMapSettings::setOutputDpi(), QgsMapSettings::setOutputSize(), QgsRenderContext::setPainter(), Solid, xGridLines(), and yGridLines().
Referenced by paint().
|
private |
Definition at line 1542 of file qgscomposermap.cpp.
References Bottom, drawGridFrameBorder(), Left, Right, sortGridLinesOnBorders(), and Top.
Referenced by drawGrid().
|
private |
Definition at line 1576 of file qgscomposermap.cpp.
References Left, mGridFrameFillColor1, mGridFrameFillColor2, mGridFramePenColor, mGridFramePenThickness, mGridFrameWidth, Right, and Top.
Referenced by drawGridFrame().
|
private |
Definition at line 1558 of file qgscomposermap.cpp.
References mGridLineSymbol, mPreviewMode, Rectangle, QgsLineSymbolV2::renderPolyline(), QgsSymbolV2::startRender(), and QgsSymbolV2::stopRender().
Referenced by drawGrid().
|
private |
Definition at line 2553 of file qgscomposermap.cpp.
References currentMapExtent(), QgsRenderContext::fromMapSettings(), QgsComposition::getComposerMapById(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, mOverviewBlendMode, mOverviewFrameMapId, mOverviewFrameMapSymbol, mOverviewInverted, mPreviewMode, mXOffset, mYOffset, QgsComposition::plotStyle(), QgsComposition::Preview, Rectangle, QgsFillSymbolV2::renderPolygon(), QgsMapSettings::setExtent(), QgsRenderContext::setForceVectorOutput(), QgsMapSettings::setOutputDpi(), QgsMapSettings::setOutputSize(), QgsRenderContext::setPainter(), QgsSymbolV2::startRender(), QgsSymbolV2::stopRender(), and visibleExtentPolygon().
Referenced by paint().
|
inline |
Definition at line 208 of file qgscomposermap.h.
Referenced by overviewExtentChanged(), QgsAtlasComposition::prepareMap(), setNewAtlasFeatureExtent(), and setNewExtent().
|
signal |
QgsComposerMap::GridAnnotationDirection QgsComposerMap::gridAnnotationDirection | ( | QgsComposerMap::Border | border | ) | const |
Definition at line 2493 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationDirection, mLeftGridAnnotationDirection, mRightGridAnnotationDirection, mTopGridAnnotationDirection, Right, and Top.
|
inline |
Definition at line 280 of file qgscomposermap.h.
|
inline |
Definition at line 311 of file qgscomposermap.h.
QgsComposerMap::GridAnnotationPosition QgsComposerMap::gridAnnotationPosition | ( | QgsComposerMap::Border | border | ) | const |
Definition at line 2449 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationPosition, mLeftGridAnnotationPosition, mRightGridAnnotationPosition, mTopGridAnnotationPosition, Right, and Top.
|
inline |
Definition at line 292 of file qgscomposermap.h.
|
private |
Definition at line 1822 of file qgscomposermap.cpp.
References Decimal, DegreeMinute, Longitude, mGridAnnotationFormat, mGridAnnotationPrecision, QgsPoint::setX(), QgsPoint::setY(), QgsPoint::toDegreesMinutes(), and QgsPoint::toDegreesMinutesSeconds().
Referenced by drawCoordinateAnnotations(), and maxExtension().
|
inline |
Returns the grid's blending mode.
Definition at line 422 of file qgscomposermap.h.
|
inline |
Definition at line 237 of file qgscomposermap.h.
|
inline |
Get first fill color for grid zebra frame.
Definition at line 340 of file qgscomposermap.h.
|
inline |
Get second fill color for grid zebra frame.
Definition at line 347 of file qgscomposermap.h.
|
inline |
Get pen color for grid frame.
Definition at line 333 of file qgscomposermap.h.
|
inline |
Definition at line 326 of file qgscomposermap.h.
|
inline |
Definition at line 316 of file qgscomposermap.h.
|
inline |
Definition at line 321 of file qgscomposermap.h.
|
inline |
Definition at line 247 of file qgscomposermap.h.
|
inline |
Definition at line 252 of file qgscomposermap.h.
|
inline |
Definition at line 419 of file qgscomposermap.h.
|
inline |
Definition at line 257 of file qgscomposermap.h.
|
inline |
Definition at line 262 of file qgscomposermap.h.
QPen QgsComposerMap::gridPen | ( | ) | const |
Definition at line 2015 of file qgscomposermap.cpp.
References QgsSymbolV2::color(), mGridLineSymbol, and QgsLineSymbolV2::width().
|
inline |
Definition at line 242 of file qgscomposermap.h.
|
inline |
Get identification number.
Definition at line 138 of file qgscomposermap.h.
References QgsComposerItem::mId.
Referenced by QgsComposition::getComposerMapById(), QgsComposerPicture::rotationMap(), QgsComposerAttributeTable::writeXML(), QgsComposerPicture::writeXML(), QgsComposerLegend::writeXML(), QgsComposerScaleBar::writeXML(), and QgsComposition::writeXML().
bool QgsComposerMap::imageSizeConsideringRotation | ( | double & | width, |
double & | height | ||
) | const |
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation.
Definition at line 2703 of file qgscomposermap.cpp.
References QgsComposerItem::imageSizeConsideringRotation(), and mMapRotation.
|
private |
Definition at line 2657 of file qgscomposermap.cpp.
References Decimal, DegreeMinute, DegreeMinuteSecond, QGis::Degrees, QgsProject::instance(), QgsComposition::mapSettings(), QgsMapSettings::mapUnits(), QgsComposerItem::mComposition, mGridAnnotationFormat, and QgsProject::readEntry().
Referenced by QgsComposerMap().
|
inline |
True if a draw is already in progress.
Definition at line 141 of file qgscomposermap.h.
Referenced by QgsComposerAttributeTable::paint(), and QgsComposition::removeComposerItem().
|
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 191 of file qgscomposermap.h.
|
inline |
Getter for stored layer set that is used if mKeepLayerSet is true.
Definition at line 198 of file qgscomposermap.h.
Referenced by readXML().
|
private |
Returns a list of the layers to render for this map item.
Definition at line 534 of file qgscomposermap.cpp.
References QgsComposition::atlasComposition(), QgsComposition::atlasMode(), QgsComposition::AtlasOff, QgsAtlasComposition::coverageLayer(), QgsAtlasComposition::hideCoverage(), QgsMapLayer::id(), QgsMapSettings::layers(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, mKeepLayerSet, and mLayerSet.
Referenced by draw(), and numberExportLayers().
|
private |
mapPolygon variant using a given extent
Definition at line 2128 of file qgscomposermap.cpp.
References mMapRotation, QgsComposerItem::rotate(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by requestedExtent(), visibleExtentPolygon(), xGridLines(), and yGridLines().
const QgsMapRenderer * QgsComposerMap::mapRenderer | ( | ) | const |
Definition at line 527 of file qgscomposermap.cpp.
References QgsComposition::mapRenderer(), QgsComposerItem::mComposition, Q_NOWARN_DEPRECATED_POP, and Q_NOWARN_DEPRECATED_PUSH.
|
inline |
Returns the rotation used for drawing the map within the composer item.
Definition at line 380 of file qgscomposermap.h.
Referenced by QgsComposition::computeWorldFileParameters(), and QgsComposerPicture::setRotationMap().
|
signal |
Is emitted on rotation change to notify north arrow pictures.
Referenced by setMapRotation().
|
private |
Transforms map coordinates to item coordinates (considering rotation and move offset)
Definition at line 2296 of file qgscomposermap.cpp.
References mMapRotation, 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 2195 of file qgscomposermap.cpp.
References currentMapExtent(), and QgsRectangle::width().
Referenced by cache(), QgsComposerLegend::drawSymbolV2(), paint(), and transformShift().
|
private |
Definition at line 2083 of file qgscomposermap.cpp.
References QgsComposerItem::fontAscentMillimeters(), gridAnnotationString(), Latitude, Longitude, mAnnotationFrameDistance, mBottomGridAnnotationPosition, QgsComposerItem::mFrame, mGridAnnotationFont, mGridEnabled, mGridFramePenThickness, mGridFrameStyle, mGridFrameWidth, mLeftGridAnnotationPosition, mRightGridAnnotationPosition, mShowGridAnnotation, mTopGridAnnotationPosition, NoGridFrame, OutsideMapFrame, QgsComposerItem::textWidthMillimeters(), xGridLines(), and yGridLines().
Referenced by updateBoundingRect().
|
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 582 of file qgscomposermap.cpp.
References cache(), currentMapExtent(), extentChanged(), QgsComposerItem::itemChanged(), mDrawing, QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), and transformShift().
|
virtual |
Get the number of layers that this item requires for exporting as layers.
Reimplemented from QgsComposerItem.
Definition at line 440 of file qgscomposermap.cpp.
References QgsComposerItem::hasBackground(), QgsComposerItem::hasFrame(), layersToRender(), mGridEnabled, and mOverviewFrameMapId.
Referenced by shouldDrawPart().
|
inline |
Returns the overview's blending mode.
Definition at line 404 of file qgscomposermap.h.
|
inline |
Returns true if the extent is forced to center on the overview.
Definition at line 414 of file qgscomposermap.h.
|
slot |
Definition at line 2227 of file qgscomposermap.cpp.
References cache(), QgsRectangle::center(), currentMapExtent(), extent(), extentChanged(), QgsComposition::getComposerMapById(), QgsRectangle::height(), QgsComposerItem::itemChanged(), QgsComposerItem::mComposition, mOverviewCentered, mOverviewFrameMapId, QgsRectangle::width(), QgsPoint::x(), and QgsPoint::y().
Referenced by setOverviewCentered(), and setOverviewFrameMap().
|
inline |
Returns id of overview frame (or -1 if no overfiew frame)
Definition at line 398 of file qgscomposermap.h.
|
inline |
Definition at line 401 of file qgscomposermap.h.
|
inline |
Returns true if the overview frame is inverted.
Definition at line 409 of file qgscomposermap.h.
void QgsComposerMap::paint | ( | QPainter * | painter, |
const QStyleOptionGraphicsItem * | itemStyle, | ||
QWidget * | pWidget | ||
) |
Reimplementation of QCanvasItem::paint - draw on canvas.
Definition at line 298 of file qgscomposermap.cpp.
References Background, currentMapExtent(), draw(), QgsComposerItem::drawBackground(), drawCanvasItems(), QgsComposerItem::drawFrame(), drawGrid(), drawOverviewMapExtent(), QgsComposerItem::drawSelectionBoxes(), Frame, Grid, QgsRectangle::height(), mapUnitsToMM(), mCacheImage, QgsComposerItem::mComposition, mDrawing, mGridEnabled, mMapRotation, mOverviewFrameMapId, mPreviewMode, mXOffset, mYOffset, OverviewMapExtent, QgsComposition::plotStyle(), QgsComposition::Postscript, QgsComposition::Preview, QgsComposition::Print, Rectangle, requestedExtent(), scale(), SelectionBoxes, shouldDrawPart(), tr, QgsRectangle::width(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
|
signal |
Is emitted when the map has been prepared for atlas rendering, just before actual rendering.
Referenced by setNewAtlasFeatureExtent().
|
inline |
Definition at line 186 of file qgscomposermap.h.
Referenced by QgsComposition::addComposerMap(), QgsComposition::addItemsFromXML(), readXML(), and QgsComposerView::wheelZoom().
|
virtual |
sets state from Dom document
itemElem | is Dom node corresponding to 'ComposerMap' tag |
doc | is Dom document |
Implements QgsComposerItem.
Definition at line 1118 of file qgscomposermap.cpp.
References QgsComposerItem::_readXML(), Auto, Cache, QgsLineSymbolV2::createSimple(), Fixed, QgsMapRenderer::getCompositionMode(), QgsComposerItem::itemChanged(), layerSet(), QgsSymbolLayerV2Utils::loadSymbol(), mAnnotationFrameDistance, mAtlasDriven, mAtlasMargin, mAtlasScalingMode, mBottomGridAnnotationDirection, mBottomGridAnnotationPosition, mCacheUpdated, mCrossLength, mDrawCanvasItems, mDrawing, mGridAnnotationFont, mGridAnnotationFontColor, mGridAnnotationFormat, mGridAnnotationPrecision, mGridEnabled, mGridFrameFillColor1, mGridFrameFillColor2, mGridFramePenColor, mGridFramePenThickness, mGridFrameStyle, mGridFrameWidth, mGridIntervalX, mGridIntervalY, mGridLineSymbol, mGridOffsetX, mGridOffsetY, mGridStyle, mId, mKeepLayerSet, mLayerSet, mLeftGridAnnotationDirection, mLeftGridAnnotationPosition, mMapRotation, mNumCachedLayers, mOverviewCentered, mOverviewFrameMapSymbol, mPreviewMode, mRightGridAnnotationDirection, mRightGridAnnotationPosition, mShowGridAnnotation, mTopGridAnnotationDirection, mTopGridAnnotationPosition, previewMode(), Rectangle, Render, QgsSymbolV2::setColor(), setGridBlendMode(), setNewExtent(), setOverviewBlendMode(), setOverviewFrameMap(), setOverviewInverted(), QgsLineSymbolV2::setWidth(), and updateBoundingRect().
Referenced by QgsComposition::addItemsFromXML().
|
slot |
Call updateCachedImage if item is in render mode.
Definition at line 514 of file qgscomposermap.cpp.
References mPreviewMode, Render, and updateCachedImage().
|
private |
Calculates the extent to request and the yShift of the top-left point in case of rotation.
Definition at line 2176 of file qgscomposermap.cpp.
References currentMapExtent(), mapPolygon(), mMapRotation, 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 573 of file qgscomposermap.cpp.
References setSceneRect(), and updateItem().
|
inline |
Returns the rotation used for drawing the map within the composer item.
Definition at line 373 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation().
double QgsComposerMap::scale | ( | ) | const |
Scale.
Definition at line 565 of file qgscomposermap.cpp.
References QgsScaleCalculator::calculate(), currentMapExtent(), QgsComposition::mapSettings(), QgsMapSettings::mapUnits(), QgsComposerItem::mComposition, QgsScaleCalculator::setDpi(), and QgsScaleCalculator::setMapUnits().
Referenced by paint(), QgsNumericScaleBarStyle::scaleText(), setNewScale(), and zoomContent().
|
inline |
Sets font color for grid annotations.
Definition at line 284 of file qgscomposermap.h.
|
inline |
Sets distance between map frame and annotations.
Definition at line 304 of file qgscomposermap.h.
|
inline |
Sets whether the map extent will follow the current atlas feature.
enabled | set to true if the map extents should be set by the current atlas feature. |
Definition at line 458 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::readXML(), and QgsAtlasComposition::setComposerMap().
void QgsComposerMap::setAtlasFixedScale | ( | bool | fixed | ) |
Set to true if the map should use a fixed scale when in atlas mode.
Definition at line 2726 of file qgscomposermap.cpp.
References Auto, Fixed, and mAtlasScalingMode.
|
inline |
Sets the margin size (percentage) used when the map is in atlas mode.
margin | size in percentage to leave around the atlas feature's extent |
Definition at line 504 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::readXML(), and QgsAtlasComposition::setMargin().
|
inline |
Sets the current atlas scaling mode.
This controls how the map's extents are calculated for the current atlas feature when an atlas composition is enabled.
mode | atlas scaling mode to set |
Definition at line 488 of file qgscomposermap.h.
Referenced by QgsAtlasComposition::readXML(), and QgsAtlasComposition::setFixedScale().
void QgsComposerMap::setCacheUpdated | ( | bool | u = false | ) |
Definition at line 522 of file qgscomposermap.cpp.
References mCacheUpdated.
|
inline |
Sets length of the cros segments (if grid style is cross)
Definition at line 361 of file qgscomposermap.h.
|
inline |
Definition at line 387 of file qgscomposermap.h.
|
virtual |
Sets frame outline width.
outlineWidth | new width for outline frame |
Reimplemented from QgsComposerItem.
Definition at line 2053 of file qgscomposermap.cpp.
References QgsComposerItem::setFrameOutlineWidth(), and updateBoundingRect().
void QgsComposerMap::setGridAnnotationDirection | ( | GridAnnotationDirection | d, |
QgsComposerMap::Border | border | ||
) |
Definition at line 2469 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationDirection, mLeftGridAnnotationDirection, mRightGridAnnotationDirection, mTopGridAnnotationDirection, Right, Top, and updateBoundingRect().
|
inline |
Sets font for grid annotations.
Definition at line 279 of file qgscomposermap.h.
|
inline |
Definition at line 310 of file qgscomposermap.h.
void QgsComposerMap::setGridAnnotationPosition | ( | GridAnnotationPosition | p, |
QgsComposerMap::Border | border | ||
) |
Definition at line 2426 of file qgscomposermap.cpp.
References Bottom, Left, mBottomGridAnnotationPosition, mLeftGridAnnotationPosition, mRightGridAnnotationPosition, mTopGridAnnotationPosition, Right, Top, and updateBoundingRect().
|
inline |
Sets coordinate precision for grid annotations.
Definition at line 291 of file qgscomposermap.h.
void QgsComposerMap::setGridBlendMode | ( | QPainter::CompositionMode | blendMode | ) |
Sets the grid's blending mode.
Definition at line 2027 of file qgscomposermap.cpp.
References QgsComposerItem::blendMode(), and mGridBlendMode.
Referenced by readXML().
|
inline |
Enables a coordinate grid that is shown on top of this composermap.
Definition at line 236 of file qgscomposermap.h.
|
inline |
Sets first fill color for grid zebra frame.
Definition at line 337 of file qgscomposermap.h.
|
inline |
Sets second fill color for grid zebra frame.
Definition at line 344 of file qgscomposermap.h.
|
inline |
Sets pen color for grid frame.
Definition at line 330 of file qgscomposermap.h.
|
inline |
Set grid frame pen thickness.
Definition at line 325 of file qgscomposermap.h.
|
inline |
Set grid frame style (NoGridFrame or Zebra)
Definition at line 315 of file qgscomposermap.h.
|
inline |
Set grid frame width.
Definition at line 320 of file qgscomposermap.h.
|
inline |
Sets coordinate interval in x-direction for composergrid.
Definition at line 246 of file qgscomposermap.h.
|
inline |
Sets coordinate interval in y-direction for composergrid.
Definition at line 251 of file qgscomposermap.h.
void QgsComposerMap::setGridLineSymbol | ( | QgsLineSymbolV2 * | symbol | ) |
Definition at line 2278 of file qgscomposermap.cpp.
References mGridLineSymbol.
|
inline |
Sets x-coordinate offset for composer grid.
Definition at line 256 of file qgscomposermap.h.
|
inline |
Sets y-coordinate offset for composer grid.
Definition at line 261 of file qgscomposermap.h.
void QgsComposerMap::setGridPen | ( | const QPen & | p | ) |
Sets the pen to draw composer grid.
Definition at line 2009 of file qgscomposermap.cpp.
References setGridPenColor(), and setGridPenWidth().
void QgsComposerMap::setGridPenColor | ( | const QColor & | c | ) |
Sets the color of the grid pen.
Definition at line 2001 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 1993 of file qgscomposermap.cpp.
References mGridLineSymbol, and QgsLineSymbolV2::setWidth().
Referenced by setGridPen().
|
inline |
Sets coordinate grid style to solid or cross.
Definition at line 241 of file qgscomposermap.h.
|
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 194 of file qgscomposermap.h.
|
inline |
Setter for stored layer set that is used if mKeepLayerSet is true.
Definition at line 201 of file qgscomposermap.h.
|
inline |
Sets canvas pointer (necessary to query and draw map canvas items)
Definition at line 385 of file qgscomposermap.h.
void QgsComposerMap::setMapRotation | ( | double | r | ) |
Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item.
Definition at line 844 of file qgscomposermap.cpp.
References QgsComposerItem::itemChanged(), mapRotationChanged(), and mMapRotation.
Referenced by setRotation().
void QgsComposerMap::setNewAtlasFeatureExtent | ( | const QgsRectangle & | extent | ) |
Sets new Extent for the current atlas preview and changes width, height (and implicitely also scale).
Atlas preview extents are only temporary, and are regenerated whenever the atlas feature changes
Definition at line 714 of file qgscomposermap.cpp.
References extent(), extentChanged(), QgsRectangle::height(), QgsComposerItem::itemChanged(), mAtlasFeatureExtent, mCacheUpdated, preparedForAtlas(), QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), updateItem(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsAtlasComposition::prepareMap().
void QgsComposerMap::setNewExtent | ( | const QgsRectangle & | extent | ) |
Sets new Extent and changes width, height (and implicitely also scale)
Definition at line 697 of file qgscomposermap.cpp.
References extent(), QgsRectangle::height(), mExtent, setSceneRect(), updateItem(), and QgsRectangle::width().
Referenced by readXML().
void QgsComposerMap::setNewScale | ( | double | scaleDenominator | ) |
Sets new scale and changes only mExtent.
Definition at line 795 of file qgscomposermap.cpp.
References QgsComposition::atlasMode(), QgsComposition::AtlasOff, cache(), QgsScaleCalculator::calculate(), currentMapExtent(), extentChanged(), Fixed, QgsComposerItem::itemChanged(), QgsComposition::mapSettings(), QgsMapSettings::mapUnits(), mAtlasDriven, mAtlasScalingMode, mCacheUpdated, QgsComposerItem::mComposition, mExtent, QgsRectangle::scale(), scale(), QgsScaleCalculator::setDpi(), and QgsScaleCalculator::setMapUnits().
void QgsComposerMap::setOffset | ( | double | xOffset, |
double | yOffset | ||
) |
Sets offset values to shift image (useful for live updates when moving item content)
Definition at line 832 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 2260 of file qgscomposermap.cpp.
References QgsComposerItem::blendMode(), and mOverviewBlendMode.
Referenced by readXML().
void QgsComposerMap::setOverviewCentered | ( | bool | centered | ) |
Set the overview's centering mode.
Definition at line 2272 of file qgscomposermap.cpp.
References mOverviewCentered, and overviewExtentChanged().
void QgsComposerMap::setOverviewFrameMap | ( | int | mapId | ) |
Sets overview frame map.
-1 disables the overview frame
Definition at line 2205 of file qgscomposermap.cpp.
References extentChanged(), QgsComposition::getComposerMapById(), QgsComposerItem::mComposition, mOverviewFrameMapId, and overviewExtentChanged().
Referenced by readXML().
void QgsComposerMap::setOverviewFrameMapSymbol | ( | QgsFillSymbolV2 * | symbol | ) |
Definition at line 2254 of file qgscomposermap.cpp.
References mOverviewFrameMapSymbol.
void QgsComposerMap::setOverviewInverted | ( | bool | inverted | ) |
Sets the overview's inversion mode.
Definition at line 2266 of file qgscomposermap.cpp.
References mOverviewInverted.
Referenced by readXML().
void QgsComposerMap::setPreviewMode | ( | PreviewMode | m | ) |
Definition at line 826 of file qgscomposermap.cpp.
References QgsComposerItem::itemChanged(), and mPreviewMode.
Referenced by QgsComposition::addComposerMap(), and QgsComposition::addItemsFromXML().
|
virtual |
Sets rotation for the map - this does not affect the composer item shape, only the way the map is drawn within the item.
Reimplemented from QgsComposerItem.
Definition at line 838 of file qgscomposermap.cpp.
References setMapRotation().
|
virtual |
Sets new scene rectangle bounds and recalculates hight and extent.
Reimplemented from QgsComposerItem.
Definition at line 678 of file qgscomposermap.cpp.
References extentChanged(), QgsComposerItem::itemChanged(), mCacheUpdated, mExtent, QgsComposerItem::setSceneRect(), updateBoundingRect(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), and QgsRectangle::yMinimum().
Referenced by QgsComposerMap(), resize(), and setNewExtent().
|
inline |
Sets flag if grid annotation should be shown.
Definition at line 296 of file qgscomposermap.h.
|
inline |
Sets whether updates to the composer map are enabled.
Definition at line 507 of file qgscomposermap.h.
Referenced by QgsComposition::addItemsFromXML().
|
private |
Test if a part of the copmosermap needs to be drawn, considering mCurrentExportLayer.
Definition at line 452 of file qgscomposermap.cpp.
References Background, Frame, Grid, QgsComposerItem::hasBackground(), QgsComposerItem::hasFrame(), QgsComposerItem::mCurrentExportLayer, mGridEnabled, mOverviewFrameMapId, numberExportLayers(), OverviewMapExtent, and SelectionBoxes.
Referenced by paint().
|
inline |
Definition at line 297 of file qgscomposermap.h.
void QgsComposerMap::sizeChangedByRotation | ( | double & | width, |
double & | height | ||
) |
Calculates width / height of the bounding box of a rotated rectangle.
Definition at line 2715 of file qgscomposermap.cpp.
References mMapRotation, and QgsComposerItem::sizeChangedByRotation().
|
private |
Definition at line 2513 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 1392 of file qgscomposermap.cpp.
References QgsMapSettings::layers(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, and mLayerSet.
|
private |
Removes layer ids from mLayerSet that are no longer present in the qgis main map.
Definition at line 1397 of file qgscomposermap.cpp.
References QgsMapLayerRegistry::instance(), QgsMapSettings::layers(), QgsMapLayerRegistry::mapLayers(), QgsComposition::mapSettings(), QgsComposerItem::mComposition, mKeepLayerSet, and mLayerSet.
Referenced by updateCachedImage().
void QgsComposerMap::toggleAtlasPreview | ( | ) |
Called when atlas preview is toggled, to force map item to update its extent and redraw.
Definition at line 754 of file qgscomposermap.cpp.
References extentChanged(), QgsComposerItem::itemChanged(), mCacheUpdated, and updateItem().
Referenced by QgsComposition::setAtlasMode().
|
private |
Returns extent that considers mOffsetX / mOffsetY (during content move)
Definition at line 2059 of file qgscomposermap.cpp.
References currentMapExtent(), mXOffset, mYOffset, and transformShift().
Referenced by mapToItemCoords().
|
private |
Returns extent that considers rotation and shift with mOffsetX / mOffsetY.
Definition at line 2067 of file qgscomposermap.cpp.
References mXOffset, mYOffset, transformShift(), and visibleExtentPolygon().
Referenced by mapToItemCoords(), xGridLines(), and yGridLines().
|
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 2284 of file qgscomposermap.cpp.
References mapUnitsToMM(), mMapRotation, and QgsComposerItem::rotate().
Referenced by moveContent(), transformedExtent(), and transformedMapPolygon().
|
inlinevirtual |
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 2038 of file qgscomposermap.cpp.
References maxExtension(), and mCurrentRectangle.
Referenced by readXML(), setFrameOutlineWidth(), setGridAnnotationDirection(), setGridAnnotationPosition(), and setSceneRect().
|
slot |
Called if map canvas has changed.
Definition at line 506 of file qgscomposermap.cpp.
References cache(), mCacheUpdated, and syncLayerSet().
Referenced by connectUpdateSlot(), renderModeUpdateCachedImage(), and QgsComposerView::wheelZoom().
|
virtual |
Updates item, with the possibility to do custom update for subclasses.
Reimplemented from QgsComposerItem.
Definition at line 852 of file qgscomposermap.cpp.
References cache(), mCacheUpdated, mPreviewMode, mUpdatesEnabled, Rectangle, and QgsComposerItem::updateItem().
Referenced by resize(), setNewAtlasFeatureExtent(), setNewExtent(), and toggleAtlasPreview().
|
inline |
Returns whether updates to the composer map are enabled.
Definition at line 510 of file qgscomposermap.h.
QPolygonF QgsComposerMap::visibleExtentPolygon | ( | ) | const |
Returns a polygon representing the current visible map extent, considering map extents and rotation.
If the map rotation is 0, the result is the same as currentMapExtent
Definition at line 2169 of file qgscomposermap.cpp.
References currentMapExtent(), and mapPolygon().
Referenced by drawOverviewMapExtent(), and transformedMapPolygon().
|
virtual |
stores state in Dom node
elem | is Dom element corresponding to 'Composer' tag |
doc | Dom document |
Implements QgsComposerItem.
Definition at line 956 of file qgscomposermap.cpp.
References QgsComposerItem::_writeXML(), Cache, QgsMapRenderer::getBlendModeEnum(), mAnnotationFrameDistance, mAtlasDriven, mAtlasMargin, mAtlasScalingMode, mBottomGridAnnotationDirection, mBottomGridAnnotationPosition, mCrossLength, mDrawCanvasItems, mExtent, mGridAnnotationFont, mGridAnnotationFontColor, mGridAnnotationFormat, mGridAnnotationPrecision, mGridBlendMode, mGridEnabled, mGridFrameFillColor1, mGridFrameFillColor2, mGridFramePenColor, mGridFramePenThickness, mGridFrameStyle, mGridFrameWidth, mGridIntervalX, mGridIntervalY, mGridLineSymbol, mGridOffsetX, mGridOffsetY, mGridStyle, mId, mKeepLayerSet, mLayerSet, mLeftGridAnnotationDirection, mLeftGridAnnotationPosition, mMapRotation, mOverviewBlendMode, mOverviewCentered, mOverviewFrameMapId, mOverviewFrameMapSymbol, mOverviewInverted, mPreviewMode, mRightGridAnnotationDirection, mRightGridAnnotationPosition, mShowGridAnnotation, mTopGridAnnotationDirection, mTopGridAnnotationPosition, qgsDoubleToString(), Render, QgsSymbolLayerV2Utils::saveSymbol(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
|
private |
Returns the grid lines with associated coordinate value.
Definition at line 1858 of file qgscomposermap.cpp.
References mapPolygon(), mapToItemCoords(), mGridIntervalY, mGridOffsetY, mMapRotation, qgsDoubleNear(), and transformedMapPolygon().
Referenced by drawGrid(), and maxExtension().
|
private |
Returns the grid lines for the y-coordinates.
Not vertical in case of rotation
Definition at line 1927 of file qgscomposermap.cpp.
References mapPolygon(), mapToItemCoords(), mGridIntervalX, mGridOffsetX, mMapRotation, qgsDoubleNear(), and transformedMapPolygon().
Referenced by drawGrid(), and maxExtension().
|
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 598 of file qgscomposermap.cpp.
References QgsComposition::atlasMode(), QgsComposition::AtlasOff, cache(), QgsScaleCalculator::calculate(), currentMapExtent(), extentChanged(), Fixed, QgsComposerItem::itemChanged(), QgsComposition::mapSettings(), QgsMapSettings::mapUnits(), mAtlasDriven, mAtlasScalingMode, QgsComposerItem::mComposition, mDrawing, mExtent, QgsRectangle::scale(), scale(), QgsScaleCalculator::setDpi(), QgsScaleCalculator::setMapUnits(), QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
|
private |
Distance between map frame and annotation.
Definition at line 648 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), maxExtension(), readXML(), and writeXML().
|
private |
True if map is being controlled by an atlas.
Definition at line 681 of file qgscomposermap.h.
Referenced by currentMapExtent(), readXML(), setNewScale(), writeXML(), and zoomContent().
|
private |
Definition at line 564 of file qgscomposermap.h.
Referenced by currentMapExtent(), and setNewAtlasFeatureExtent().
|
private |
Margin size for atlas driven extents (percentage of feature size) - when in auto scaling mode.
Definition at line 685 of file qgscomposermap.h.
Referenced by readXML(), and writeXML().
|
private |
Current atlas scaling mode.
Definition at line 683 of file qgscomposermap.h.
Referenced by atlasFixedScale(), readXML(), setAtlasFixedScale(), setNewScale(), writeXML(), and zoomContent().
|
private |
Annotation direction on bottom side ( horizontal or vertical )
Definition at line 657 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
|
private |
Annotation position for bottom map side (inside / outside / not shown)
Definition at line 645 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
|
private |
Definition at line 567 of file qgscomposermap.h.
|
private |
Definition at line 570 of file qgscomposermap.h.
Referenced by cache(), QgsComposerMap(), readXML(), setCacheUpdated(), setNewAtlasFeatureExtent(), setNewScale(), setSceneRect(), toggleAtlasPreview(), updateCachedImage(), and updateItem().
|
private |
The length of the cross sides for mGridStyle Cross.
Definition at line 671 of file qgscomposermap.h.
Referenced by drawGrid(), readXML(), and writeXML().
|
private |
Current bounding rectangle.
This is used to check if notification to the graphics scene is necessary
Definition at line 669 of file qgscomposermap.h.
Referenced by boundingRect(), QgsComposerMap(), and updateBoundingRect().
|
private |
True if annotation items, rubber band, etc.
from the main canvas should be displayed
Definition at line 674 of file qgscomposermap.h.
Referenced by drawCanvasItems(), readXML(), and writeXML().
|
private |
set to true if in state of drawing.
Concurrent requests to draw method are returned if set to true
Definition at line 579 of file qgscomposermap.h.
Referenced by cache(), moveContent(), paint(), QgsComposerMap(), readXML(), and zoomContent().
|
private |
Definition at line 559 of file qgscomposermap.h.
Referenced by currentMapExtent(), QgsComposerMap(), setNewExtent(), setNewScale(), setSceneRect(), writeXML(), and zoomContent().
|
private |
Font for grid line annotation.
Definition at line 628 of file qgscomposermap.h.
Referenced by drawAnnotation(), drawCoordinateAnnotation(), maxExtension(), QgsComposerMap(), readXML(), and writeXML().
|
private |
Font color for grid line annotation.
Definition at line 630 of file qgscomposermap.h.
Referenced by drawAnnotation(), readXML(), and writeXML().
|
private |
Definition at line 659 of file qgscomposermap.h.
Referenced by gridAnnotationString(), initGridAnnotationFormatFromProject(), readXML(), and writeXML().
|
private |
Digits after the dot.
Definition at line 632 of file qgscomposermap.h.
Referenced by gridAnnotationString(), readXML(), and writeXML().
|
private |
Blend mode for grid.
Definition at line 636 of file qgscomposermap.h.
Referenced by drawGrid(), setGridBlendMode(), and writeXML().
|
private |
True if coordinate grid has to be displayed.
Definition at line 616 of file qgscomposermap.h.
Referenced by maxExtension(), numberExportLayers(), paint(), readXML(), shouldDrawPart(), and writeXML().
|
private |
Definition at line 665 of file qgscomposermap.h.
Referenced by drawGridFrameBorder(), readXML(), and writeXML().
|
private |
Definition at line 666 of file qgscomposermap.h.
Referenced by drawGridFrameBorder(), readXML(), and writeXML().
|
private |
Definition at line 664 of file qgscomposermap.h.
Referenced by drawGridFrameBorder(), readXML(), and writeXML().
|
private |
Definition at line 663 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), drawGridFrameBorder(), maxExtension(), readXML(), and writeXML().
|
private |
Definition at line 661 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), drawGrid(), maxExtension(), readXML(), and writeXML().
|
private |
Definition at line 662 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), drawGridFrameBorder(), maxExtension(), readXML(), and writeXML().
|
private |
Grid line interval in x-direction (map units)
Definition at line 620 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and yGridLines().
|
private |
Grid line interval in y-direction (map units)
Definition at line 622 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and xGridLines().
|
private |
Definition at line 599 of file qgscomposermap.h.
Referenced by createDefaultGridLineSymbol(), drawGridLine(), gridPen(), QgsComposerMap(), readXML(), setGridLineSymbol(), setGridPenColor(), setGridPenWidth(), writeXML(), and ~QgsComposerMap().
|
private |
Grid line offset in x-direction.
Definition at line 624 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and yGridLines().
|
private |
Grid line offset in y-direction.
Definition at line 626 of file qgscomposermap.h.
Referenced by readXML(), writeXML(), and xGridLines().
|
private |
Solid or crosses.
Definition at line 618 of file qgscomposermap.h.
Referenced by drawGrid(), readXML(), and writeXML().
|
private |
Unique identifier.
Definition at line 554 of file qgscomposermap.h.
Referenced by assignFreeId(), QgsComposerMap(), readXML(), and writeXML().
|
private |
Flag if layers to be displayed should be read from qgis canvas (true) or from stored list in mLayerSet (false)
Definition at line 590 of file qgscomposermap.h.
Referenced by layersToRender(), readXML(), syncLayerSet(), and writeXML().
|
private |
Stored layer list (used if layer live-link mKeepLayerSet is disabled)
Definition at line 593 of file qgscomposermap.h.
Referenced by layersToRender(), readXML(), storeCurrentLayerSet(), syncLayerSet(), and writeXML().
|
private |
Annotation direction on left side ( horizontal or vertical )
Definition at line 651 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
|
private |
Annotation position for left map side (inside / outside / not shown)
Definition at line 639 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
|
private |
Definition at line 672 of file qgscomposermap.h.
Referenced by composerMapPosForItem(), drawCanvasItem(), and drawCanvasItems().
|
private |
Map rotation.
Definition at line 587 of file qgscomposermap.h.
Referenced by cornerPointOnRotatedAndScaledRect(), imageSizeConsideringRotation(), mapPolygon(), mapToItemCoords(), paint(), readXML(), requestedExtent(), setMapRotation(), sizeChangedByRotation(), transformShift(), writeXML(), xGridLines(), and yGridLines().
|
private |
Number of layers when cache was created.
Definition at line 576 of file qgscomposermap.h.
Referenced by readXML().
|
private |
Blend mode for overview.
Definition at line 601 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), setOverviewBlendMode(), and writeXML().
|
private |
Centering mode for overview.
Definition at line 604 of file qgscomposermap.h.
Referenced by overviewExtentChanged(), readXML(), setOverviewCentered(), and writeXML().
|
private |
Id of map which displays its extent rectangle into this composer map (overview map functionality).
-1 if not present
Definition at line 596 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), numberExportLayers(), overviewExtentChanged(), paint(), setOverviewFrameMap(), shouldDrawPart(), and writeXML().
|
private |
Drawing style for overview farme.
Definition at line 598 of file qgscomposermap.h.
Referenced by createDefaultOverviewFrameSymbol(), drawOverviewMapExtent(), QgsComposerMap(), readXML(), setOverviewFrameMapSymbol(), writeXML(), and ~QgsComposerMap().
|
private |
Definition at line 602 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), setOverviewInverted(), and writeXML().
|
private |
Preview style.
Definition at line 573 of file qgscomposermap.h.
Referenced by cache(), drawGridLine(), drawOverviewMapExtent(), paint(), QgsComposerMap(), readXML(), renderModeUpdateCachedImage(), setPreviewMode(), updateItem(), and writeXML().
|
private |
Annotation direction on right side ( horizontal or vertical )
Definition at line 653 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
|
private |
Annotation position for right map side (inside / outside / not shown)
Definition at line 641 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
|
private |
True if coordinate values should be drawn.
Definition at line 634 of file qgscomposermap.h.
Referenced by drawGrid(), maxExtension(), readXML(), and writeXML().
|
private |
Annotation direction on top side ( horizontal or vertical )
Definition at line 655 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().
|
private |
Annotation position for top map side (inside / outside / not shown)
Definition at line 643 of file qgscomposermap.h.
Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().
|
private |
Whether updates to the map are enabled.
Definition at line 607 of file qgscomposermap.h.
Referenced by updateItem().
|
private |
Offset in x direction for showing map cache image.
Definition at line 582 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), paint(), QgsComposerMap(), setOffset(), transformedExtent(), and transformedMapPolygon().
|
private |
Offset in y direction for showing map cache image.
Definition at line 584 of file qgscomposermap.h.
Referenced by drawOverviewMapExtent(), paint(), QgsComposerMap(), setOffset(), transformedExtent(), and transformedMapPolygon().