17 #ifndef QGSCOMPOSERMAP_H
18 #define QGSCOMPOSERMAP_H
24 #include <QGraphicsRectItem>
114 void draw( QPainter *painter,
const QgsRectangle& extent,
const QSizeF&
size,
double dpi,
double* forceWidthScale = 0 );
117 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
129 void resize(
double dx,
double dy );
146 double scale()
const;
149 void setNewScale(
double scaleDenominator );
155 void setPreviewMode( PreviewMode m );
169 void setLayerSet(
const QStringList& layerSet ) {mLayerSet = layerSet;}
171 void storeCurrentLayerSet();
174 void setCacheUpdated(
bool u =
false );
181 void setOffset(
double xOffset,
double yOffset );
184 bool containsWMSLayer()
const;
187 bool containsAdvancedEffects()
const;
193 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
199 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
233 void setGridPen(
const QPen& p );
234 QPen gridPen()
const;
238 void setGridPenWidth(
double w );
242 void setGridPenColor(
const QColor& c );
292 QRectF boundingRect()
const;
295 void updateBoundingRect();
302 void setMapRotation(
double r );
313 double mapUnitsToMM()
const;
317 void setOverviewFrameMap(
int mapId );
328 void setOverviewBlendMode( QPainter::CompositionMode blendMode );
333 void setOverviewInverted(
bool inverted );
341 void setGridBlendMode( QPainter::CompositionMode blendMode );
348 void extentChanged();
353 void updateCachedImage( );
355 void renderModeUpdateCachedImage();
413 void connectUpdateSlot();
476 void drawGrid( QPainter* p );
477 void drawGridFrame( QPainter* p,
const QList< QPair< double, QLineF > >& hLines,
const QList< QPair< double, QLineF > >& vLines );
482 void drawCoordinateAnnotations( QPainter* p,
const QList< QPair< double, QLineF > >& hLines,
const QList< QPair< double, QLineF > >& vLines );
483 void drawCoordinateAnnotation( QPainter* p,
const QPointF& pos, QString annotationString );
489 void drawAnnotation( QPainter* p,
const QPointF& pos,
int rotation,
const QString& annotationText );
493 int xGridLines( QList< QPair< double, QLineF > >& lines )
const;
496 int yGridLines( QList< QPair< double, QLineF > >& lines )
const;
500 QPolygonF transformedMapPolygon()
const;
501 double maxExtension()
const;
505 void mapPolygon( QPolygonF& poly )
const;
511 void transformShift(
double& xShift,
double& yShift )
const;
513 QPointF mapToItemCoords(
const QPointF& mapCoords )
const;
515 Border borderForLineCoord(
const QPointF& p )
const;
517 void drawCanvasItems( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
518 void drawCanvasItem( QGraphicsItem* item, QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
519 QPointF composerMapPosForItem(
const QGraphicsItem* item )
const;
520 void sortGridLinesOnBorders(
const QList< QPair< double, QLineF > >& hLines,
const QList< QPair< double, QLineF > >& vLines, QMap< double, double >& leftFrameEntries,
521 QMap< double, double >& rightFrameEntries, QMap< double, double >& topFrameEntries, QMap< double, double >& bottomFrameEntries )
const;
522 void drawGridFrameBorder( QPainter* p,
const QMap< double, double >& borderPos,
Border border );
523 void drawGridLine(
const QLineF& line, QPainter* p );
524 void drawOverviewMapExtent( QPainter* p );
525 void createDefaultOverviewFrameSymbol();
526 void createDefaultGridLineSymbol();
527 void initGridAnnotationFormatFromProject();