17 #ifndef QGSCOMPOSERMAP_H 18 #define QGSCOMPOSERMAP_H 24 #include <QGraphicsRectItem> 104 DegreeMinuteSecondPadded
161 int id()
const {
return mId;}
167 void resize(
double dx,
double dy );
181 Q_DECL_DEPRECATED
void zoomContent(
int delta,
double x,
double y )
override;
195 double scale()
const;
198 void setNewScale(
double scaleDenominator,
bool forceUpdate =
true );
221 void setNewAtlasFeatureExtent(
const QgsRectangle& extent );
252 void storeCurrentLayerSet();
264 void storeCurrentLayerStyles();
267 void setCacheUpdated(
bool u =
false );
275 void setOffset(
double xOffset,
double yOffset );
278 bool containsWMSLayer()
const;
281 bool containsAdvancedEffects()
const;
298 Q_DECL_DEPRECATED
void setGridEnabled(
bool enabled );
303 Q_DECL_DEPRECATED
bool gridEnabled()
const;
308 Q_DECL_DEPRECATED
void setGridStyle(
GridStyle style );
313 Q_DECL_DEPRECATED
GridStyle gridStyle()
const;
318 Q_DECL_DEPRECATED
void setGridIntervalX(
double interval );
323 Q_DECL_DEPRECATED
double gridIntervalX()
const;
328 Q_DECL_DEPRECATED
void setGridIntervalY(
double interval );
333 Q_DECL_DEPRECATED
double gridIntervalY()
const;
338 Q_DECL_DEPRECATED
void setGridOffsetX(
double offset );
343 Q_DECL_DEPRECATED
double gridOffsetX()
const;
348 Q_DECL_DEPRECATED
void setGridOffsetY(
double offset );
353 Q_DECL_DEPRECATED
double gridOffsetY()
const;
358 Q_DECL_DEPRECATED
void setGridPen(
const QPen& p );
363 Q_DECL_DEPRECATED
QPen gridPen()
const;
368 Q_DECL_DEPRECATED
void setGridPenWidth(
double w );
373 Q_DECL_DEPRECATED
void setGridPenColor(
const QColor& c );
378 Q_DECL_DEPRECATED
void setGridAnnotationFont(
const QFont& f );
383 Q_DECL_DEPRECATED
QFont gridAnnotationFont()
const;
388 Q_DECL_DEPRECATED
void setAnnotationFontColor(
const QColor& c );
393 Q_DECL_DEPRECATED
QColor annotationFontColor()
const;
398 Q_DECL_DEPRECATED
void setGridAnnotationPrecision(
int p );
403 Q_DECL_DEPRECATED
int gridAnnotationPrecision()
const;
408 Q_DECL_DEPRECATED
void setShowGridAnnotation(
bool show );
413 Q_DECL_DEPRECATED
bool showGridAnnotation()
const;
428 Q_DECL_DEPRECATED
void setAnnotationFrameDistance(
double d );
433 Q_DECL_DEPRECATED
double annotationFrameDistance()
const;
468 Q_DECL_DEPRECATED
void setGridFrameWidth(
double w );
473 Q_DECL_DEPRECATED
double gridFrameWidth()
const;
479 Q_DECL_DEPRECATED
void setGridFramePenSize(
double w );
484 Q_DECL_DEPRECATED
double gridFramePenSize()
const;
490 Q_DECL_DEPRECATED
void setGridFramePenColor(
const QColor& c );
496 Q_DECL_DEPRECATED
QColor gridFramePenColor()
const;
502 Q_DECL_DEPRECATED
void setGridFrameFillColor1(
const QColor& c );
508 Q_DECL_DEPRECATED
QColor gridFrameFillColor1()
const;
514 Q_DECL_DEPRECATED
void setGridFrameFillColor2(
const QColor& c );
520 Q_DECL_DEPRECATED
QColor gridFrameFillColor2()
const;
525 Q_DECL_DEPRECATED
void setCrossLength(
double l );
530 Q_DECL_DEPRECATED
double crossLength();
545 Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode()
const;
550 Q_DECL_DEPRECATED
void setGridBlendMode( QPainter::CompositionMode blendMode );
592 Q_DECL_DEPRECATED
void setRotation(
double r )
override;
597 Q_DECL_DEPRECATED
double rotation()
const {
return mMapRotation;}
603 void setMapRotation(
double r );
622 double mapUnitsToMM()
const;
627 Q_DECL_DEPRECATED
void setOverviewFrameMap(
int mapId );
632 Q_DECL_DEPRECATED
int overviewFrameMapId()
const;
637 Q_DECL_DEPRECATED
void setOverviewFrameMapSymbol(
QgsFillSymbolV2* symbol );
647 Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode()
const;
652 Q_DECL_DEPRECATED
void setOverviewBlendMode( QPainter::CompositionMode blendMode );
657 Q_DECL_DEPRECATED
bool overviewInverted()
const;
662 Q_DECL_DEPRECATED
void setOverviewInverted(
bool inverted );
667 Q_DECL_DEPRECATED
bool overviewCentered()
const;
672 Q_DECL_DEPRECATED
void setOverviewCentered(
bool centered );
706 void setAtlasDriven(
bool enabled );
711 Q_DECL_DEPRECATED
bool atlasFixedScale()
const;
716 Q_DECL_DEPRECATED
void setAtlasFixedScale(
bool fixed );
788 Q_DECL_DEPRECATED
void connectMapOverviewSignals();
797 void extentChanged();
800 void mapRotationChanged(
double newRotation );
803 void preparedForAtlas();
809 void layerStyleOverridesChanged();
814 void updateCachedImage();
819 void renderModeUpdateCachedImage();
822 void updateBoundingRect();
835 void layersChanged();
866 int mNumCachedLayers;
880 double mEvaluatedMapRotation;
888 bool mKeepLayerStyles;
893 bool mUpdatesEnabled;
896 void connectUpdateSlot();
911 bool mDrawCanvasItems;
915 void adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle& extent )
const;
927 void updateToolTip();
944 void transformShift(
double& xShift,
double& yShift )
const;
961 bool shouldDrawPart( PartType part )
const;
970 friend class TestQgsComposerMap;
AtlasScalingMode
Scaling modes used for the serial rendering (atlas)
bool atlasDriven() const
Returns whether the map extent is set to follow the current atlas feature.
A rectangle specified with double values.
virtual QString displayName() const
Get item display name.
Q_DECL_DEPRECATED void toggleAtlasPreview()
Called when atlas preview is toggled, to force map item to update its extent and redraw.
void overviewExtentChanged()
bool drawCanvasItems() const
QgsComposerMapOverviewStack * overviews()
Returns the map item's overview stack, which is used to control how overviews are drawn over the map'...
virtual void setRotation(double r)
Sets the item rotation.
QStringList layerSet() const
Getter for stored layer set that is used if mKeepLayerSet is true.
QgsRectangle extent() const
ZoomMode
Modes for zooming item content.
A collection of grids which is drawn above the map content in a QgsComposerMap.
A item that forms part of a map composition.
#define Q_NOWARN_DEPRECATED_PUSH
bool updatesEnabled() const
Returns whether updates to the composer map are enabled.
Border
Enum for different frame borders.
virtual int numberExportLayers() const
Get the number of layers that this item requires for exporting as layers.
int id() const
Get identification number.
void setMapCanvas(QGraphicsView *canvas)
Sets canvas pointer (necessary to query and draw map canvas items)
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
A non GUI class for rendering a map layer set onto a QPainter.
virtual QgsExpressionContext * createExpressionContext() const override
Creates an expression context relating to the item's current state.
DataDefinedProperty
Data defined properties for different item types.
An interface for annotation items which are drawn over a map.
void setKeepLayerStyles(bool enabled)
Setter for flag that determines if current styles of layers should be overridden by previously stored...
The QgsMapSettings class contains configuration for rendering of the map.
void setAtlasMargin(double margin)
Sets the margin size (percentage) used when the map is in atlas mode.
Perform transforms between map coordinates and device coordinates.
virtual QRectF boundingRect() const
virtual void moveContent(double dx, double dy)
Move Content of item.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void setAtlasScalingMode(AtlasScalingMode mode)
Sets the current atlas scaling mode.
An individual overview which is drawn above the map content in a QgsComposerMap, and shows the extent...
virtual void updateItem()
Updates item, with the possibility to do custom update for subclasses.
virtual int type() const override
Return correct graphics item type.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=nullptr) override
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
QMap< QString, QString > layerStyleOverrides() const
Getter for stored overrides of styles for layers.
An individual grid which is drawn above the map content in a QgsComposerMap.
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value...
bool keepLayerStyles() const
Getter for flag that determines if current styles of layers should be overridden by previously stored...
bool isDrawing() const
True if a draw is already in progress.
PreviewMode
Preview style.
Graphics scene for map printing.
Object representing map window.
void setUpdatesEnabled(bool enabled)
Sets whether updates to the composer map are enabled.
virtual void setFrameOutlineWidth(const double outlineWidth)
Sets frame outline width.
#define Q_NOWARN_DEPRECATED_POP
virtual Q_DECL_DEPRECATED void zoomContent(int delta, double x, double y)
Zoom content of item.
AtlasScalingMode atlasScalingMode() const
Returns the current atlas scaling mode.
PreviewMode previewMode() const
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
void setLayerSet(const QStringList &layerSet)
Setter for stored layer set that is used if mKeepLayerSet is true.
QgsComposerMapGridStack * grids()
Returns the map item's grid stack, which is used to control how grids are drawn over the map's conten...
void setDrawCanvasItems(bool b)
virtual void setSceneRect(const QRectF &rectangle)
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
void setKeepLayerSet(bool enabled)
Setter for flag that determines if the stored layer set should be used or the current layer set of th...
Represents a vector layer which manages a vector based data sets.
bool keepLayerSet() const
Getter for flag that determines if the stored layer set should be used or the current layer set of th...
Q_DECL_DEPRECATED double rotation() const
Returns the rotation used for drawing the map within the composer item.
Q_DECL_DEPRECATED 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 give...
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.
A collection of overviews which are drawn above the map content in a QgsComposerMap.