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 );
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 );
193 double scale()
const;
196 void setNewScale(
double scaleDenominator,
bool forceUpdate =
true );
219 void setNewAtlasFeatureExtent(
const QgsRectangle& extent );
236 void setPreviewMode( PreviewMode m );
250 void setLayerSet(
const QStringList& layerSet ) {mLayerSet = layerSet;}
252 void storeCurrentLayerSet();
255 void setCacheUpdated(
bool u =
false );
263 void setOffset(
double xOffset,
double yOffset );
266 bool containsWMSLayer()
const;
269 bool containsAdvancedEffects()
const;
275 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
281 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
287 Q_DECL_DEPRECATED
void setGridEnabled(
bool enabled );
292 Q_DECL_DEPRECATED
bool gridEnabled()
const;
298 Q_DECL_DEPRECATED
void setGridStyle( GridStyle style );
303 Q_DECL_DEPRECATED GridStyle gridStyle()
const;
309 Q_DECL_DEPRECATED
void setGridIntervalX(
double interval );
314 Q_DECL_DEPRECATED
double gridIntervalX()
const;
320 Q_DECL_DEPRECATED
void setGridIntervalY(
double interval );
325 Q_DECL_DEPRECATED
double gridIntervalY()
const;
331 Q_DECL_DEPRECATED
void setGridOffsetX(
double offset );
336 Q_DECL_DEPRECATED
double gridOffsetX()
const;
342 Q_DECL_DEPRECATED
void setGridOffsetY(
double offset );
347 Q_DECL_DEPRECATED
double gridOffsetY()
const;
353 Q_DECL_DEPRECATED
void setGridPen(
const QPen& p );
358 Q_DECL_DEPRECATED QPen gridPen()
const;
364 Q_DECL_DEPRECATED
void setGridPenWidth(
double w );
370 Q_DECL_DEPRECATED
void setGridPenColor(
const QColor& c );
376 Q_DECL_DEPRECATED
void setGridAnnotationFont(
const QFont& f );
381 Q_DECL_DEPRECATED QFont gridAnnotationFont()
const;
386 Q_DECL_DEPRECATED
void setAnnotationFontColor(
const QColor& c );
391 Q_DECL_DEPRECATED QColor annotationFontColor()
const;
397 Q_DECL_DEPRECATED
void setGridAnnotationPrecision(
int p );
402 Q_DECL_DEPRECATED
int gridAnnotationPrecision()
const;
408 Q_DECL_DEPRECATED
void setShowGridAnnotation(
bool show );
413 Q_DECL_DEPRECATED
bool showGridAnnotation()
const;
418 Q_DECL_DEPRECATED
void setGridAnnotationPosition( GridAnnotationPosition p,
QgsComposerMap::Border border );
429 Q_DECL_DEPRECATED
void setAnnotationFrameDistance(
double d );
434 Q_DECL_DEPRECATED
double annotationFrameDistance()
const;
439 Q_DECL_DEPRECATED
void setGridAnnotationDirection( GridAnnotationDirection d,
QgsComposerMap::Border border );
449 Q_DECL_DEPRECATED
void setGridAnnotationFormat( GridAnnotationFormat f );
454 Q_DECL_DEPRECATED GridAnnotationFormat gridAnnotationFormat()
const;
459 Q_DECL_DEPRECATED
void setGridFrameStyle( GridFrameStyle style );
464 Q_DECL_DEPRECATED GridFrameStyle gridFrameStyle()
const;
469 Q_DECL_DEPRECATED
void setGridFrameWidth(
double w );
474 Q_DECL_DEPRECATED
double gridFrameWidth()
const;
480 Q_DECL_DEPRECATED
void setGridFramePenSize(
double w );
485 Q_DECL_DEPRECATED
double gridFramePenSize()
const;
491 Q_DECL_DEPRECATED
void setGridFramePenColor(
const QColor& c );
497 Q_DECL_DEPRECATED QColor gridFramePenColor()
const;
503 Q_DECL_DEPRECATED
void setGridFrameFillColor1(
const QColor& c );
509 Q_DECL_DEPRECATED QColor gridFrameFillColor1()
const;
515 Q_DECL_DEPRECATED
void setGridFrameFillColor2(
const QColor& c );
521 Q_DECL_DEPRECATED QColor gridFrameFillColor2()
const;
527 Q_DECL_DEPRECATED
void setCrossLength(
double l );
532 Q_DECL_DEPRECATED
double crossLength();
547 Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode()
const;
552 Q_DECL_DEPRECATED
void setGridBlendMode( QPainter::CompositionMode blendMode );
586 QRectF boundingRect()
const;
600 Q_DECL_DEPRECATED
double rotation()
const {
return mMapRotation;}
605 void setMapRotation(
double r );
624 double mapUnitsToMM()
const;
629 Q_DECL_DEPRECATED
void setOverviewFrameMap(
int mapId );
634 Q_DECL_DEPRECATED
int overviewFrameMapId()
const;
639 Q_DECL_DEPRECATED
void setOverviewFrameMapSymbol(
QgsFillSymbolV2* symbol );
649 Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode()
const;
654 Q_DECL_DEPRECATED
void setOverviewBlendMode( QPainter::CompositionMode blendMode );
659 Q_DECL_DEPRECATED
bool overviewInverted()
const;
664 Q_DECL_DEPRECATED
void setOverviewInverted(
bool inverted );
669 Q_DECL_DEPRECATED
bool overviewCentered()
const;
674 Q_DECL_DEPRECATED
void setOverviewCentered(
bool centered );
708 void setAtlasDriven(
bool enabled );
713 Q_DECL_DEPRECATED
bool atlasFixedScale()
const;
718 Q_DECL_DEPRECATED
void setAtlasFixedScale(
bool fixed );
778 QPolygonF visibleExtentPolygon()
const;
784 QPolygonF transformedMapPolygon()
const;
787 QPointF mapToItemCoords(
const QPointF& mapCoords )
const;
789 Q_DECL_DEPRECATED
void connectMapOverviewSignals();
796 void extentChanged();
799 void mapRotationChanged(
double newRotation );
802 void preparedForAtlas();
807 void updateCachedImage();
809 void renderModeUpdateCachedImage();
813 void updateBoundingRect();
846 PreviewMode mPreviewMode;
849 int mNumCachedLayers;
863 double mEvaluatedMapRotation;
869 QStringList mLayerSet;
872 bool mUpdatesEnabled;
875 void connectUpdateSlot();
887 QRectF mCurrentRectangle;
888 QGraphicsView* mMapCanvas;
890 bool mDrawCanvasItems;
894 void adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle& extent )
const;
899 AtlasScalingMode mAtlasScalingMode;
906 void updateToolTip();
909 QStringList layersToRender()
const;
915 void mapPolygon(
const QgsRectangle& extent, QPolygonF& poly )
const;
920 void transformShift(
double& xShift,
double& yShift )
const;
922 void drawCanvasItems( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
923 void drawCanvasItem( QGraphicsItem* item, QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
924 QPointF composerMapPosForItem(
const QGraphicsItem* item )
const;
937 bool shouldDrawPart( PartType part )
const;
942 void refreshMapExtents();