17 #ifndef QGSCOMPOSERMAP_H
18 #define QGSCOMPOSERMAP_H
24 #include <QGraphicsRectItem>
103 DegreeMinuteSecondPadded
147 void draw( QPainter *painter,
const QgsRectangle& extent,
const QSizeF&
size,
double dpi,
double* forceWidthScale = 0 );
150 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
override;
160 int id()
const {
return mId;}
166 void resize(
double dx,
double dy );
179 Q_DECL_DEPRECATED
void zoomContent(
int delta,
double x,
double y )
override;
193 double scale()
const;
196 void setNewScale(
double scaleDenominator,
bool forceUpdate =
true );
219 void setNewAtlasFeatureExtent(
const QgsRectangle& extent );
236 void setPreviewMode( PreviewMode m );
246 void setLayerSet(
const QStringList& layerSet ) {mLayerSet = layerSet;}
248 void storeCurrentLayerSet();
260 void storeCurrentLayerStyles();
263 void setCacheUpdated(
bool u =
false );
271 void setOffset(
double xOffset,
double yOffset );
274 bool containsWMSLayer()
const;
277 bool containsAdvancedEffects()
const;
283 bool writeXML( QDomElement& elem, QDomDocument & doc )
const override;
289 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc )
override;
294 Q_DECL_DEPRECATED
void setGridEnabled(
bool enabled );
299 Q_DECL_DEPRECATED
bool gridEnabled()
const;
304 Q_DECL_DEPRECATED
void setGridStyle( GridStyle style );
309 Q_DECL_DEPRECATED GridStyle gridStyle()
const;
314 Q_DECL_DEPRECATED
void setGridIntervalX(
double interval );
319 Q_DECL_DEPRECATED
double gridIntervalX()
const;
324 Q_DECL_DEPRECATED
void setGridIntervalY(
double interval );
329 Q_DECL_DEPRECATED
double gridIntervalY()
const;
334 Q_DECL_DEPRECATED
void setGridOffsetX(
double offset );
339 Q_DECL_DEPRECATED
double gridOffsetX()
const;
344 Q_DECL_DEPRECATED
void setGridOffsetY(
double offset );
349 Q_DECL_DEPRECATED
double gridOffsetY()
const;
354 Q_DECL_DEPRECATED
void setGridPen(
const QPen& p );
359 Q_DECL_DEPRECATED QPen gridPen()
const;
364 Q_DECL_DEPRECATED
void setGridPenWidth(
double w );
369 Q_DECL_DEPRECATED
void setGridPenColor(
const QColor& c );
374 Q_DECL_DEPRECATED
void setGridAnnotationFont(
const QFont& f );
379 Q_DECL_DEPRECATED QFont gridAnnotationFont()
const;
384 Q_DECL_DEPRECATED
void setAnnotationFontColor(
const QColor& c );
389 Q_DECL_DEPRECATED QColor annotationFontColor()
const;
394 Q_DECL_DEPRECATED
void setGridAnnotationPrecision(
int p );
399 Q_DECL_DEPRECATED
int gridAnnotationPrecision()
const;
404 Q_DECL_DEPRECATED
void setShowGridAnnotation(
bool show );
409 Q_DECL_DEPRECATED
bool showGridAnnotation()
const;
414 Q_DECL_DEPRECATED
void setGridAnnotationPosition( GridAnnotationPosition p,
QgsComposerMap::Border border );
424 Q_DECL_DEPRECATED
void setAnnotationFrameDistance(
double d );
429 Q_DECL_DEPRECATED
double annotationFrameDistance()
const;
434 Q_DECL_DEPRECATED
void setGridAnnotationDirection( GridAnnotationDirection d,
QgsComposerMap::Border border );
444 Q_DECL_DEPRECATED
void setGridAnnotationFormat( GridAnnotationFormat f );
449 Q_DECL_DEPRECATED GridAnnotationFormat gridAnnotationFormat()
const;
454 Q_DECL_DEPRECATED
void setGridFrameStyle( GridFrameStyle style );
459 Q_DECL_DEPRECATED GridFrameStyle gridFrameStyle()
const;
464 Q_DECL_DEPRECATED
void setGridFrameWidth(
double w );
469 Q_DECL_DEPRECATED
double gridFrameWidth()
const;
475 Q_DECL_DEPRECATED
void setGridFramePenSize(
double w );
480 Q_DECL_DEPRECATED
double gridFramePenSize()
const;
486 Q_DECL_DEPRECATED
void setGridFramePenColor(
const QColor& c );
492 Q_DECL_DEPRECATED QColor gridFramePenColor()
const;
498 Q_DECL_DEPRECATED
void setGridFrameFillColor1(
const QColor& c );
504 Q_DECL_DEPRECATED QColor gridFrameFillColor1()
const;
510 Q_DECL_DEPRECATED
void setGridFrameFillColor2(
const QColor& c );
516 Q_DECL_DEPRECATED QColor gridFrameFillColor2()
const;
521 Q_DECL_DEPRECATED
void setCrossLength(
double l );
526 Q_DECL_DEPRECATED
double crossLength();
541 Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode()
const;
546 Q_DECL_DEPRECATED
void setGridBlendMode( QPainter::CompositionMode blendMode );
579 QRectF boundingRect()
const override;
588 Q_DECL_DEPRECATED
void setRotation(
double r )
override;
593 Q_DECL_DEPRECATED
double rotation()
const {
return mMapRotation;}
598 void setMapRotation(
double r );
617 double mapUnitsToMM()
const;
622 Q_DECL_DEPRECATED
void setOverviewFrameMap(
int mapId );
627 Q_DECL_DEPRECATED
int overviewFrameMapId()
const;
632 Q_DECL_DEPRECATED
void setOverviewFrameMapSymbol(
QgsFillSymbolV2* symbol );
642 Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode()
const;
647 Q_DECL_DEPRECATED
void setOverviewBlendMode( QPainter::CompositionMode blendMode );
652 Q_DECL_DEPRECATED
bool overviewInverted()
const;
657 Q_DECL_DEPRECATED
void setOverviewInverted(
bool inverted );
662 Q_DECL_DEPRECATED
bool overviewCentered()
const;
667 Q_DECL_DEPRECATED
void setOverviewCentered(
bool centered );
701 void setAtlasDriven(
bool enabled );
706 Q_DECL_DEPRECATED
bool atlasFixedScale()
const;
711 Q_DECL_DEPRECATED
void setAtlasFixedScale(
bool fixed );
771 QPolygonF visibleExtentPolygon()
const;
777 QPolygonF transformedMapPolygon()
const;
780 QPointF mapToItemCoords(
const QPointF& mapCoords )
const;
782 Q_DECL_DEPRECATED
void connectMapOverviewSignals();
789 void extentChanged();
792 void mapRotationChanged(
double newRotation );
795 void preparedForAtlas();
800 void updateCachedImage();
802 void renderModeUpdateCachedImage();
805 void updateBoundingRect();
838 PreviewMode mPreviewMode;
841 int mNumCachedLayers;
855 double mEvaluatedMapRotation;
861 QStringList mLayerSet;
863 bool mKeepLayerStyles;
865 QMap<QString, QString> mLayerStyleOverrides;
868 bool mUpdatesEnabled;
871 void connectUpdateSlot();
883 QRectF mCurrentRectangle;
884 QGraphicsView* mMapCanvas;
886 bool mDrawCanvasItems;
890 void adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle& extent )
const;
895 AtlasScalingMode mAtlasScalingMode;
902 void updateToolTip();
905 QStringList layersToRender()
const;
911 void mapPolygon(
const QgsRectangle& extent, QPolygonF& poly )
const;
916 void transformShift(
double& xShift,
double& yShift )
const;
918 void drawCanvasItems( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
919 void drawCanvasItem( QGraphicsItem* item, QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
920 QPointF composerMapPosForItem(
const QGraphicsItem* item )
const;
933 bool shouldDrawPart( PartType part )
const;
938 void refreshMapExtents();