17 #ifndef QGSCOMPOSERMAP_H
18 #define QGSCOMPOSERMAP_H
23 #include <QGraphicsRectItem>
81 void draw( QPainter *painter,
const QgsRectangle& extent,
const QSize& size,
int dpi );
88 void draw( QPainter *painter,
const QgsRectangle& extent,
const QSizeF& size,
double dpi );
91 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
97 int id()
const {
return mId;}
103 void resize(
double dx,
double dy );
120 double scale(
void )
const;
123 void setNewScale(
double scaleDenominator );
143 void setLayerSet(
const QStringList& layerSet ) {mLayerSet = layerSet;}
145 void storeCurrentLayerSet();
148 void setCacheUpdated(
bool u =
false );
155 void setOffset(
double xOffset,
double yOffset );
158 bool containsWMSLayer()
const;
164 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
170 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
208 void setGridPenWidth(
double w );
211 void setGridPenColor(
const QColor& c );
245 QRectF boundingRect()
const;
248 void updateBoundingRect();
255 void setMapRotation(
double r );
264 double mapUnitsToMM()
const;
267 void extentChanged();
272 void updateCachedImage( );
274 void renderModeUpdateCachedImage();
326 void connectUpdateSlot();
366 void drawGrid( QPainter* p );
371 void drawCoordinateAnnotations( QPainter* p,
const QList< QPair< double, QLineF > >& hLines,
const QList< QPair< double, QLineF > >& vLines );
372 void drawCoordinateAnnotation( QPainter* p,
const QPointF& pos, QString annotationString );
378 void drawAnnotation( QPainter* p,
const QPointF& pos,
int rotation,
const QString& annotationText );
381 int xGridLines( QList< QPair< double, QLineF > >& lines )
const;
384 int yGridLines( QList< QPair< double, QLineF > >& lines )
const;
388 QPolygonF transformedMapPolygon()
const;
389 double maxExtension()
const;
393 void mapPolygon( QPolygonF& poly )
const;
399 void transformShift(
double& xShift,
double& yShift )
const;
401 QPointF mapToItemCoords(
const QPointF& mapCoords )
const;
403 Border borderForLineCoord(
const QPointF& p )
const;
405 void drawCanvasItems( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
406 void drawCanvasItem( QGraphicsItem* item, QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle );
407 QPointF composerMapPosForItem(
const QGraphicsItem* item )
const;