17 #ifndef QGSCOMPOSERMAP_H 18 #define QGSCOMPOSERMAP_H 24 #include <QGraphicsRectItem> 103 DegreeMinuteSecondPadded
160 int id()
const {
return mId;}
166 void resize(
double dx,
double dy );
180 Q_DECL_DEPRECATED
void zoomContent(
int delta,
double x,
double y )
override;
194 double scale()
const;
197 void setNewScale(
double scaleDenominator,
bool forceUpdate =
true );
220 void setNewAtlasFeatureExtent(
const QgsRectangle& extent );
251 void storeCurrentLayerSet();
263 void storeCurrentLayerStyles();
266 void setCacheUpdated(
bool u =
false );
274 void setOffset(
double xOffset,
double yOffset );
277 bool containsWMSLayer()
const;
280 bool containsAdvancedEffects()
const;
297 Q_DECL_DEPRECATED
void setGridEnabled(
bool enabled );
302 Q_DECL_DEPRECATED
bool gridEnabled()
const;
307 Q_DECL_DEPRECATED
void setGridStyle(
GridStyle style );
312 Q_DECL_DEPRECATED
GridStyle gridStyle()
const;
317 Q_DECL_DEPRECATED
void setGridIntervalX(
double interval );
322 Q_DECL_DEPRECATED
double gridIntervalX()
const;
327 Q_DECL_DEPRECATED
void setGridIntervalY(
double interval );
332 Q_DECL_DEPRECATED
double gridIntervalY()
const;
337 Q_DECL_DEPRECATED
void setGridOffsetX(
double offset );
342 Q_DECL_DEPRECATED
double gridOffsetX()
const;
347 Q_DECL_DEPRECATED
void setGridOffsetY(
double offset );
352 Q_DECL_DEPRECATED
double gridOffsetY()
const;
357 Q_DECL_DEPRECATED
void setGridPen(
const QPen& p );
362 Q_DECL_DEPRECATED
QPen gridPen()
const;
367 Q_DECL_DEPRECATED
void setGridPenWidth(
double w );
372 Q_DECL_DEPRECATED
void setGridPenColor(
const QColor& c );
377 Q_DECL_DEPRECATED
void setGridAnnotationFont(
const QFont& f );
382 Q_DECL_DEPRECATED
QFont gridAnnotationFont()
const;
387 Q_DECL_DEPRECATED
void setAnnotationFontColor(
const QColor& c );
392 Q_DECL_DEPRECATED
QColor annotationFontColor()
const;
397 Q_DECL_DEPRECATED
void setGridAnnotationPrecision(
int p );
402 Q_DECL_DEPRECATED
int gridAnnotationPrecision()
const;
407 Q_DECL_DEPRECATED
void setShowGridAnnotation(
bool show );
412 Q_DECL_DEPRECATED
bool showGridAnnotation()
const;
427 Q_DECL_DEPRECATED
void setAnnotationFrameDistance(
double d );
432 Q_DECL_DEPRECATED
double annotationFrameDistance()
const;
467 Q_DECL_DEPRECATED
void setGridFrameWidth(
double w );
472 Q_DECL_DEPRECATED
double gridFrameWidth()
const;
478 Q_DECL_DEPRECATED
void setGridFramePenSize(
double w );
483 Q_DECL_DEPRECATED
double gridFramePenSize()
const;
489 Q_DECL_DEPRECATED
void setGridFramePenColor(
const QColor& c );
495 Q_DECL_DEPRECATED
QColor gridFramePenColor()
const;
501 Q_DECL_DEPRECATED
void setGridFrameFillColor1(
const QColor& c );
507 Q_DECL_DEPRECATED
QColor gridFrameFillColor1()
const;
513 Q_DECL_DEPRECATED
void setGridFrameFillColor2(
const QColor& c );
519 Q_DECL_DEPRECATED
QColor gridFrameFillColor2()
const;
524 Q_DECL_DEPRECATED
void setCrossLength(
double l );
529 Q_DECL_DEPRECATED
double crossLength();
544 Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode()
const;
549 Q_DECL_DEPRECATED
void setGridBlendMode( QPainter::CompositionMode blendMode );
591 Q_DECL_DEPRECATED
void setRotation(
double r )
override;
596 Q_DECL_DEPRECATED
double rotation()
const {
return mMapRotation;}
602 void setMapRotation(
double r );
621 double mapUnitsToMM()
const;
626 Q_DECL_DEPRECATED
void setOverviewFrameMap(
int mapId );
631 Q_DECL_DEPRECATED
int overviewFrameMapId()
const;
636 Q_DECL_DEPRECATED
void setOverviewFrameMapSymbol(
QgsFillSymbolV2* symbol );
646 Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode()
const;
651 Q_DECL_DEPRECATED
void setOverviewBlendMode( QPainter::CompositionMode blendMode );
656 Q_DECL_DEPRECATED
bool overviewInverted()
const;
661 Q_DECL_DEPRECATED
void setOverviewInverted(
bool inverted );
666 Q_DECL_DEPRECATED
bool overviewCentered()
const;
671 Q_DECL_DEPRECATED
void setOverviewCentered(
bool centered );
705 void setAtlasDriven(
bool enabled );
710 Q_DECL_DEPRECATED
bool atlasFixedScale()
const;
715 Q_DECL_DEPRECATED
void setAtlasFixedScale(
bool fixed );
787 Q_DECL_DEPRECATED
void connectMapOverviewSignals();
796 void extentChanged();
799 void mapRotationChanged(
double newRotation );
802 void preparedForAtlas();
808 void layerStyleOverridesChanged();
813 void updateCachedImage();
818 void renderModeUpdateCachedImage();
821 void updateBoundingRect();
834 void layersChanged();
865 int mNumCachedLayers;
879 double mEvaluatedMapRotation;
887 bool mKeepLayerStyles;
892 bool mUpdatesEnabled;
895 void connectUpdateSlot();
910 bool mDrawCanvasItems;
914 void adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle& extent )
const;
926 void updateToolTip();
943 void transformShift(
double& xShift,
double& yShift )
const;
960 bool shouldDrawPart( PartType part )
const;
969 friend class TestQgsComposerMap;
AtlasScalingMode
Scaling modes used for the serial rendering (atlas)
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...
A rectangle specified with double values.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
bool updatesEnabled() const
Returns whether updates to the composer map are enabled.
Q_DECL_DEPRECATED void toggleAtlasPreview()
Called when atlas preview is toggled, to force map item to update its extent and redraw.
void overviewExtentChanged()
QgsComposerMapOverviewStack * overviews()
Returns the map item's overview stack, which is used to control how overviews are drawn over the map'...
bool keepLayerStyles() const
Getter for flag that determines if current styles of layers should be overridden by previously stored...
virtual void setRotation(double r)
Sets the item rotation.
ZoomMode
Modes for zooming item content.
A collection of grids which is drawn above the map content in a QgsComposerMap.
QStringList layerSet() const
Getter for stored layer set that is used if mKeepLayerSet is true.
A item that forms part of a map composition.
#define Q_NOWARN_DEPRECATED_PUSH
Border
Enum for different frame borders.
void setMapCanvas(QGraphicsView *canvas)
Sets canvas pointer (necessary to query and draw map canvas items)
QMap< QString, QString > layerStyleOverrides() const
Getter for stored overrides of styles for layers.
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.
void setKeepLayerStyles(bool enabled)
Setter 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.
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.
bool drawCanvasItems() const
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...
virtual int numberExportLayers() const
Get the number of layers that this item requires for exporting as 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...
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.
PreviewMode previewMode() const
virtual QString displayName() const
Get item display name.
virtual void setFrameOutlineWidth(const double outlineWidth)
Sets frame outline width.
#define Q_NOWARN_DEPRECATED_POP
int id() const
Get identification number.
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
virtual Q_DECL_DEPRECATED void zoomContent(int delta, double x, double y)
Zoom content of item.
Q_DECL_DEPRECATED double rotation() const
Returns the rotation used for drawing the map within the composer item.
QgsRectangle extent() 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...
AtlasScalingMode atlasScalingMode() const
Returns the current atlas scaling mode.
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...
bool atlasDriven() const
Returns whether the map extent is set to follow the current atlas feature.
bool keepLayerSet() const
Getter 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.
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.