QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
QgsComposerMapGrid Class Reference

#include <qgscomposermapgrid.h>

Collaboration diagram for QgsComposerMapGrid:
Collaboration graph
[legend]

Public Types

enum  GridUnit { MapUnit, MM, CM }
 

Public Member Functions

 QgsComposerMapGrid (const QString &name, QgsComposerMap *map)
 
 ~QgsComposerMapGrid ()
 
void drawGrid (QPainter *painter) const
 Reimplementation of QCanvasItem::paint. More...
 
bool writeXML (QDomElement &elem, QDomDocument &doc) const
 stores state in Dom element More...
 
bool readXML (const QDomElement &itemElem, const QDomDocument &doc)
 sets state from Dom document More...
 
void setComposerMap (QgsComposerMap *map)
 
const QgsComposerMapcomposerMap () const
 
void setName (const QString &name)
 
QString name () const
 
QString id () const
 
void setGridEnabled (bool enabled)
 Enables a coordinate grid that is shown on top of this composermap. More...
 
bool gridEnabled () const
 
void setGridStyle (QgsComposerMap::GridStyle style)
 Sets coordinate grid style to solid or cross. More...
 
QgsComposerMap::GridStyle gridStyle () const
 
void setGridIntervalX (double interval)
 Sets coordinate interval in x-direction for composergrid. More...
 
double gridIntervalX () const
 
void setGridIntervalY (double interval)
 Sets coordinate interval in y-direction for composergrid. More...
 
double gridIntervalY () const
 
void setGridOffsetX (double offset)
 Sets x-coordinate offset for composer grid. More...
 
double gridOffsetX () const
 
void setGridOffsetY (double offset)
 Sets y-coordinate offset for composer grid. More...
 
double gridOffsetY () const
 
void setGridPen (const QPen &p)
 Sets the pen to draw composer grid. More...
 
QPen gridPen () const
 
void setGridPenWidth (double w)
 Sets with of grid pen. More...
 
void setGridPenColor (const QColor &c)
 Sets the color of the grid pen. More...
 
void setGridAnnotationFont (const QFont &f)
 Sets font for grid annotations. More...
 
QFont gridAnnotationFont () const
 
void setGridAnnotationFontColor (const QColor &c)
 
QColor gridAnnotationFontColor () const
 
void setGridAnnotationPrecision (int p)
 Sets coordinate precision for grid annotations. More...
 
int gridAnnotationPrecision () const
 
void setShowGridAnnotation (bool show)
 Sets flag if grid annotation should be shown. More...
 
bool showGridAnnotation () const
 
void setGridAnnotationPosition (QgsComposerMap::GridAnnotationPosition p, QgsComposerMap::Border border)
 
QgsComposerMap::GridAnnotationPosition gridAnnotationPosition (QgsComposerMap::Border border) const
 
void setAnnotationFrameDistance (double d)
 Sets distance between map frame and annotations. More...
 
double annotationFrameDistance () const
 
void setGridAnnotationDirection (QgsComposerMap::GridAnnotationDirection d, QgsComposerMap::Border border)
 
QgsComposerMap::GridAnnotationDirection gridAnnotationDirection (QgsComposerMap::Border border) const
 
void setGridAnnotationDirection (QgsComposerMap::GridAnnotationDirection d)
 Sets grid annotation direction. More...
 
QgsComposerMap::GridAnnotationDirection gridAnnotationDirection () const
 
void setGridAnnotationFormat (QgsComposerMap::GridAnnotationFormat f)
 
QgsComposerMap::GridAnnotationFormat gridAnnotationFormat () const
 
void setGridFrameStyle (QgsComposerMap::GridFrameStyle style)
 Set grid frame style (NoGridFrame or Zebra) More...
 
QgsComposerMap::GridFrameStyle gridFrameStyle () const
 
void setGridFrameWidth (double w)
 Set grid frame width. More...
 
double gridFrameWidth () const
 
void setGridFramePenSize (double w)
 Set grid frame pen thickness. More...
 
double gridFramePenSize () const
 
void setGridFramePenColor (const QColor &c)
 Sets pen color for grid frame. More...
 
QColor gridFramePenColor () const
 Get pen color for grid frame. More...
 
void setGridFrameFillColor1 (const QColor &c)
 Sets first fill color for grid zebra frame. More...
 
QColor gridFrameFillColor1 () const
 Get first fill color for grid zebra frame. More...
 
void setGridFrameFillColor2 (const QColor &c)
 Sets second fill color for grid zebra frame. More...
 
QColor gridFrameFillColor2 () const
 Get second fill color for grid zebra frame. More...
 
void setCrossLength (double l)
 Sets length of the cros segments (if grid style is cross) More...
 
double crossLength () const
 
void setGridLineSymbol (QgsLineSymbolV2 *symbol)
 
const QgsLineSymbolV2gridLineSymbol () const
 
QgsLineSymbolV2gridLineSymbol ()
 
void setGridMarkerSymbol (QgsMarkerSymbolV2 *symbol)
 
const QgsMarkerSymbolV2gridMarkerSymbol () const
 
QgsMarkerSymbolV2gridMarkerSymbol ()
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 
QgsCoordinateReferenceSystem crs () const
 
void setGridUnit (GridUnit u)
 
GridUnit gridUnit () const
 
void setBlendMode (QPainter::CompositionMode mode)
 
QPainter::CompositionMode blendMode () const
 
double maxExtension () const
 

Private Member Functions

 QgsComposerMapGrid ()
 
void drawGridFrame (QPainter *p, const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines) const
 Draws the map grid. More...
 
void drawCoordinateAnnotations (QPainter *p, const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines) const
 Draw coordinates for mGridAnnotationType Coordinate. More...
 
void drawCoordinateAnnotation (QPainter *p, const QPointF &pos, QString annotationString) const
 
void drawAnnotation (QPainter *p, const QPointF &pos, int rotation, const QString &annotationText) const
 Draws a single annotation. More...
 
QString gridAnnotationString (double value, QgsComposerMap::AnnotationCoordinate coord) const
 
int xGridLines (QList< QPair< double, QLineF > > &lines) const
 Returns the grid lines with associated coordinate value. More...
 
int yGridLines (QList< QPair< double, QLineF > > &lines) const
 Returns the grid lines for the y-coordinates. More...
 
int xGridLinesCRSTransform (const QgsRectangle &bbox, const QgsCoordinateTransform &t, QList< QPair< double, QPolygonF > > &lines) const
 
int yGridLinesCRSTransform (const QgsRectangle &bbox, const QgsCoordinateTransform &t, QList< QPair< double, QPolygonF > > &lines) const
 
void drawGridLine (const QLineF &line, QgsRenderContext &context) const
 
void drawGridLine (const QPolygonF &line, QgsRenderContext &context) const
 
void sortGridLinesOnBorders (const QList< QPair< double, QLineF > > &hLines, const QList< QPair< double, QLineF > > &vLines, QMap< double, double > &leftFrameEntries, QMap< double, double > &rightFrameEntries, QMap< double, double > &topFrameEntries, QMap< double, double > &bottomFrameEntries) const
 
void drawGridFrameBorder (QPainter *p, const QMap< double, double > &borderPos, QgsComposerMap::Border border) const
 
QgsComposerMap::Border borderForLineCoord (const QPointF &p) const
 Returns the item border of a point (in item coordinates) More...
 
int crsGridParams (QgsRectangle &crsRect, QgsCoordinateTransform &inverseTransform) const
 Get parameters for drawing grid in CRS different to map CRS. More...
 
QPolygonF scalePolygon (const QPolygonF &polygon, const double scale) const
 
void drawGridCRSTransform (QgsRenderContext &context, double dotsPerMM, QList< QPair< double, QLineF > > &horizontalLines, QList< QPair< double, QLineF > > &verticalLines) const
 Draws grid if CRS is different to map CRS. More...
 
void drawGridNoTransform (QgsRenderContext &context, double dotsPerMM, QList< QPair< double, QLineF > > &horizontalLines, QList< QPair< double, QLineF > > &verticalLines) const
 
void createDefaultGridLineSymbol ()
 
void createDefaultGridMarkerSymbol ()
 
void drawGridMarker (const QPointF &point, QgsRenderContext &context) const
 

Static Private Member Functions

static QPolygonF trimLineToMap (const QPolygonF &line, const QgsRectangle &rect)
 

Private Attributes

QgsComposerMapmComposerMap
 
QString mName
 
QString mUuid
 
bool mGridEnabled
 True if coordinate grid has to be displayed. More...
 
QgsComposerMap::GridStyle mGridStyle
 Solid or crosses. More...
 
double mGridIntervalX
 Grid line interval in x-direction (map units) More...
 
double mGridIntervalY
 Grid line interval in y-direction (map units) More...
 
double mGridOffsetX
 Grid line offset in x-direction. More...
 
double mGridOffsetY
 Grid line offset in y-direction. More...
 
QFont mGridAnnotationFont
 Font for grid line annotation. More...
 
QColor mGridAnnotationFontColor
 Font color for grid coordinates. More...
 
int mGridAnnotationPrecision
 Digits after the dot. More...
 
bool mShowGridAnnotation
 True if coordinate values should be drawn. More...
 
QgsComposerMap::GridAnnotationPosition mLeftGridAnnotationPosition
 Annotation position for left map side (inside / outside / not shown) More...
 
QgsComposerMap::GridAnnotationPosition mRightGridAnnotationPosition
 Annotation position for right map side (inside / outside / not shown) More...
 
QgsComposerMap::GridAnnotationPosition mTopGridAnnotationPosition
 Annotation position for top map side (inside / outside / not shown) More...
 
QgsComposerMap::GridAnnotationPosition mBottomGridAnnotationPosition
 Annotation position for bottom map side (inside / outside / not shown) More...
 
double mAnnotationFrameDistance
 Distance between map frame and annotation. More...
 
QgsComposerMap::GridAnnotationDirection mLeftGridAnnotationDirection
 Annotation direction on left side ( horizontal or vertical ) More...
 
QgsComposerMap::GridAnnotationDirection mRightGridAnnotationDirection
 Annotation direction on right side ( horizontal or vertical ) More...
 
QgsComposerMap::GridAnnotationDirection mTopGridAnnotationDirection
 Annotation direction on top side ( horizontal or vertical ) More...
 
QgsComposerMap::GridAnnotationDirection mBottomGridAnnotationDirection
 Annotation direction on bottom side ( horizontal or vertical ) More...
 
QgsComposerMap::GridAnnotationFormat mGridAnnotationFormat
 
QgsComposerMap::GridFrameStyle mGridFrameStyle
 
double mGridFrameWidth
 
double mGridFramePenThickness
 
QColor mGridFramePenColor
 
QColor mGridFrameFillColor1
 
QColor mGridFrameFillColor2
 
double mCrossLength
 
QgsLineSymbolV2mGridLineSymbol
 
QgsMarkerSymbolV2mGridMarkerSymbol
 
QgsCoordinateReferenceSystem mCRS
 
GridUnit mGridUnit
 
QPainter::CompositionMode mBlendMode
 

Detailed Description

Definition at line 32 of file qgscomposermapgrid.h.

Member Enumeration Documentation

Enumerator
MapUnit 
MM 
CM 

Definition at line 36 of file qgscomposermapgrid.h.

Constructor & Destructor Documentation

QgsComposerMapGrid::QgsComposerMapGrid ( const QString &  name,
QgsComposerMap map 
)
QgsComposerMapGrid::~QgsComposerMapGrid ( )

Definition at line 85 of file qgscomposermapgrid.cpp.

References mGridLineSymbol, and mGridMarkerSymbol.

QgsComposerMapGrid::QgsComposerMapGrid ( )
private

Definition at line 81 of file qgscomposermapgrid.cpp.

Member Function Documentation

double QgsComposerMapGrid::annotationFrameDistance ( ) const
inline

Definition at line 137 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::annotationFrameDistance().

QPainter::CompositionMode QgsComposerMapGrid::blendMode ( ) const
inline

Definition at line 206 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridBlendMode().

QgsComposerMap::Border QgsComposerMapGrid::borderForLineCoord ( const QPointF &  p) const
private

Returns the item border of a point (in item coordinates)

Definition at line 1160 of file qgscomposermapgrid.cpp.

References QgsComposerMap::Bottom, QgsComposerItem::hasFrame(), QgsComposerMap::Left, mComposerMap, QgsComposerMap::Right, and QgsComposerMap::Top.

Referenced by drawCoordinateAnnotation(), and sortGridLinesOnBorders().

const QgsComposerMap* QgsComposerMapGrid::composerMap ( ) const
inline

Definition at line 63 of file qgscomposermapgrid.h.

void QgsComposerMapGrid::createDefaultGridLineSymbol ( )
private

Definition at line 91 of file qgscomposermapgrid.cpp.

References QgsLineSymbolV2::createSimple(), and mGridLineSymbol.

Referenced by QgsComposerMapGrid().

void QgsComposerMapGrid::createDefaultGridMarkerSymbol ( )
private

Definition at line 101 of file qgscomposermapgrid.cpp.

References QgsMarkerSymbolV2::createSimple(), and mGridMarkerSymbol.

Referenced by QgsComposerMapGrid().

double QgsComposerMapGrid::crossLength ( ) const
inline

Definition at line 189 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::crossLength().

QgsCoordinateReferenceSystem QgsComposerMapGrid::crs ( ) const
inline

Definition at line 200 of file qgscomposermapgrid.h.

int QgsComposerMapGrid::crsGridParams ( QgsRectangle crsRect,
QgsCoordinateTransform inverseTransform 
) const
private
void QgsComposerMapGrid::drawAnnotation ( QPainter *  p,
const QPointF &  pos,
int  rotation,
const QString &  annotationText 
) const
private

Draws a single annotation.

Parameters
pdrawing painter
positem coordinates where to draw
rotationtext rotation
annotationTextthe text to draw

Definition at line 812 of file qgscomposermapgrid.cpp.

References QgsComposerUtils::drawText(), mComposerMap, mGridAnnotationFont, and mGridAnnotationFontColor.

Referenced by drawCoordinateAnnotation().

void QgsComposerMapGrid::drawCoordinateAnnotation ( QPainter *  p,
const QPointF &  pos,
QString  annotationString 
) const
private
void QgsComposerMapGrid::drawCoordinateAnnotations ( QPainter *  p,
const QList< QPair< double, QLineF > > &  hLines,
const QList< QPair< double, QLineF > > &  vLines 
) const
private

Draw coordinates for mGridAnnotationType Coordinate.

Parameters
pdrawing painter
hLineshorizontal coordinate lines in item coordinates
vLinesvertical coordinate lines in item coordinates

Definition at line 624 of file qgscomposermapgrid.cpp.

References drawCoordinateAnnotation(), gridAnnotationString(), QgsComposerMap::Latitude, and QgsComposerMap::Longitude.

Referenced by drawGrid().

void QgsComposerMapGrid::drawGrid ( QPainter *  painter) const
void QgsComposerMapGrid::drawGridCRSTransform ( QgsRenderContext context,
double  dotsPerMM,
QList< QPair< double, QLineF > > &  horizontalLines,
QList< QPair< double, QLineF > > &  verticalLines 
) const
private

Draws grid if CRS is different to map CRS.

Definition at line 305 of file qgscomposermapgrid.cpp.

References crsGridParams(), drawGridLine(), mComposerMap, mGridEnabled, scalePolygon(), xGridLines(), xGridLinesCRSTransform(), yGridLines(), and yGridLinesCRSTransform().

Referenced by drawGrid().

void QgsComposerMapGrid::drawGridFrame ( QPainter *  p,
const QList< QPair< double, QLineF > > &  hLines,
const QList< QPair< double, QLineF > > &  vLines 
) const
private
void QgsComposerMapGrid::drawGridFrameBorder ( QPainter *  p,
const QMap< double, double > &  borderPos,
QgsComposerMap::Border  border 
) const
private
void QgsComposerMapGrid::drawGridLine ( const QLineF &  line,
QgsRenderContext context 
) const
private

Definition at line 536 of file qgscomposermapgrid.cpp.

Referenced by drawGridCRSTransform(), and drawGridNoTransform().

void QgsComposerMapGrid::drawGridLine ( const QPolygonF &  line,
QgsRenderContext context 
) const
private
void QgsComposerMapGrid::drawGridMarker ( const QPointF &  point,
QgsRenderContext context 
) const
private
void QgsComposerMapGrid::drawGridNoTransform ( QgsRenderContext context,
double  dotsPerMM,
QList< QPair< double, QLineF > > &  horizontalLines,
QList< QPair< double, QLineF > > &  verticalLines 
) const
private
QgsComposerMap::GridAnnotationDirection QgsComposerMapGrid::gridAnnotationDirection ( QgsComposerMap::Border  border) const
QgsComposerMap::GridAnnotationDirection QgsComposerMapGrid::gridAnnotationDirection ( ) const

Definition at line 1309 of file qgscomposermapgrid.cpp.

References mLeftGridAnnotationDirection.

QFont QgsComposerMapGrid::gridAnnotationFont ( ) const
inline

Definition at line 116 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridAnnotationFont().

QColor QgsComposerMapGrid::gridAnnotationFontColor ( ) const
inline

Definition at line 119 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::annotationFontColor().

QgsComposerMap::GridAnnotationFormat QgsComposerMapGrid::gridAnnotationFormat ( ) const
inline

Definition at line 148 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridAnnotationFormat().

QgsComposerMap::GridAnnotationPosition QgsComposerMapGrid::gridAnnotationPosition ( QgsComposerMap::Border  border) const
int QgsComposerMapGrid::gridAnnotationPrecision ( ) const
inline

Definition at line 124 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridAnnotationPrecision().

QString QgsComposerMapGrid::gridAnnotationString ( double  value,
QgsComposerMap::AnnotationCoordinate  coord 
) const
private
bool QgsComposerMapGrid::gridEnabled ( ) const
inline

Definition at line 73 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridEnabled().

QColor QgsComposerMapGrid::gridFrameFillColor1 ( ) const
inline

Get first fill color for grid zebra frame.

Note
: this function was added in version 2.1

Definition at line 177 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridFrameFillColor1().

QColor QgsComposerMapGrid::gridFrameFillColor2 ( ) const
inline

Get second fill color for grid zebra frame.

Note
: this function was added in version 2.1

Definition at line 184 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridFrameFillColor2().

QColor QgsComposerMapGrid::gridFramePenColor ( ) const
inline

Get pen color for grid frame.

Note
: this function was added in version 2.1

Definition at line 170 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridFramePenColor().

double QgsComposerMapGrid::gridFramePenSize ( ) const
inline

Definition at line 163 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridFramePenSize().

QgsComposerMap::GridFrameStyle QgsComposerMapGrid::gridFrameStyle ( ) const
inline

Definition at line 153 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridFrameStyle().

double QgsComposerMapGrid::gridFrameWidth ( ) const
inline

Definition at line 158 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridFrameWidth().

double QgsComposerMapGrid::gridIntervalX ( ) const
inline

Definition at line 83 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridIntervalX(), and yGridLines().

double QgsComposerMapGrid::gridIntervalY ( ) const
inline

Definition at line 88 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridIntervalY(), and xGridLines().

const QgsLineSymbolV2* QgsComposerMapGrid::gridLineSymbol ( ) const
inline

Definition at line 192 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridLineSymbol().

QgsLineSymbolV2* QgsComposerMapGrid::gridLineSymbol ( )
inline

Definition at line 193 of file qgscomposermapgrid.h.

const QgsMarkerSymbolV2* QgsComposerMapGrid::gridMarkerSymbol ( ) const
inline

Definition at line 196 of file qgscomposermapgrid.h.

QgsMarkerSymbolV2* QgsComposerMapGrid::gridMarkerSymbol ( )
inline

Definition at line 197 of file qgscomposermapgrid.h.

double QgsComposerMapGrid::gridOffsetX ( ) const
inline

Definition at line 93 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridOffsetX(), and yGridLines().

double QgsComposerMapGrid::gridOffsetY ( ) const
inline

Definition at line 98 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridOffsetY(), and xGridLines().

QPen QgsComposerMapGrid::gridPen ( ) const
QgsComposerMap::GridStyle QgsComposerMapGrid::gridStyle ( ) const
inline

Definition at line 78 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::gridStyle().

GridUnit QgsComposerMapGrid::gridUnit ( ) const
inline

Definition at line 203 of file qgscomposermapgrid.h.

QString QgsComposerMapGrid::id ( ) const
inline

Definition at line 68 of file qgscomposermapgrid.h.

double QgsComposerMapGrid::maxExtension ( ) const
QString QgsComposerMapGrid::name ( ) const
inline

Definition at line 66 of file qgscomposermapgrid.h.

bool QgsComposerMapGrid::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc 
)
QPolygonF QgsComposerMapGrid::scalePolygon ( const QPolygonF &  polygon,
const double  scale 
) const
private

Definition at line 299 of file qgscomposermapgrid.cpp.

Referenced by drawGridCRSTransform().

void QgsComposerMapGrid::setAnnotationFrameDistance ( double  d)
inline

Sets distance between map frame and annotations.

Note
this function was added in version 1.4

Definition at line 136 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setAnnotationFrameDistance().

void QgsComposerMapGrid::setBlendMode ( QPainter::CompositionMode  mode)
inline
void QgsComposerMapGrid::setComposerMap ( QgsComposerMap map)

Definition at line 111 of file qgscomposermapgrid.cpp.

References mComposerMap.

void QgsComposerMapGrid::setCrossLength ( double  l)
inline

Sets length of the cros segments (if grid style is cross)

Note
this function was added in version 1.4

Definition at line 188 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setCrossLength().

void QgsComposerMapGrid::setCrs ( const QgsCoordinateReferenceSystem crs)
inline

Definition at line 199 of file qgscomposermapgrid.h.

void QgsComposerMapGrid::setGridAnnotationDirection ( QgsComposerMap::GridAnnotationDirection  d,
QgsComposerMap::Border  border 
)
void QgsComposerMapGrid::setGridAnnotationDirection ( QgsComposerMap::GridAnnotationDirection  d)

Sets grid annotation direction.

Can be horizontal, vertical, direction of axis and horizontal and vertical

Note
provides compatibility with 1.8 version

Definition at line 1314 of file qgscomposermapgrid.cpp.

References mBottomGridAnnotationDirection, mLeftGridAnnotationDirection, mRightGridAnnotationDirection, and mTopGridAnnotationDirection.

void QgsComposerMapGrid::setGridAnnotationFont ( const QFont &  f)
inline

Sets font for grid annotations.

Note
this function was added in version 1.4

Definition at line 115 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridAnnotationFont().

void QgsComposerMapGrid::setGridAnnotationFontColor ( const QColor &  c)
inline
void QgsComposerMapGrid::setGridAnnotationFormat ( QgsComposerMap::GridAnnotationFormat  f)
inline
void QgsComposerMapGrid::setGridAnnotationPosition ( QgsComposerMap::GridAnnotationPosition  p,
QgsComposerMap::Border  border 
)
void QgsComposerMapGrid::setGridAnnotationPrecision ( int  p)
inline

Sets coordinate precision for grid annotations.

Note
this function was added in version 1.4

Definition at line 123 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridAnnotationPrecision().

void QgsComposerMapGrid::setGridEnabled ( bool  enabled)
inline

Enables a coordinate grid that is shown on top of this composermap.

Note
this function was added in version 1.4

Definition at line 72 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridEnabled().

void QgsComposerMapGrid::setGridFrameFillColor1 ( const QColor &  c)
inline

Sets first fill color for grid zebra frame.

Note
: this function was added in version 2.1

Definition at line 174 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridFrameFillColor1().

void QgsComposerMapGrid::setGridFrameFillColor2 ( const QColor &  c)
inline

Sets second fill color for grid zebra frame.

Note
: this function was added in version 2.1

Definition at line 181 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridFrameFillColor2().

void QgsComposerMapGrid::setGridFramePenColor ( const QColor &  c)
inline

Sets pen color for grid frame.

Note
: this function was added in version 2.1

Definition at line 167 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridFramePenColor().

void QgsComposerMapGrid::setGridFramePenSize ( double  w)
inline

Set grid frame pen thickness.

Note
: this function was added in version 2.1

Definition at line 162 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridFramePenSize().

void QgsComposerMapGrid::setGridFrameStyle ( QgsComposerMap::GridFrameStyle  style)
inline

Set grid frame style (NoGridFrame or Zebra)

Note
: this function was added in version 1.9

Definition at line 152 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridFrameStyle().

void QgsComposerMapGrid::setGridFrameWidth ( double  w)
inline

Set grid frame width.

Note
: this function was added in version 1.9

Definition at line 157 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridFrameWidth().

void QgsComposerMapGrid::setGridIntervalX ( double  interval)
inline

Sets coordinate interval in x-direction for composergrid.

Note
this function was added in version 1.4

Definition at line 82 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridIntervalX().

void QgsComposerMapGrid::setGridIntervalY ( double  interval)
inline

Sets coordinate interval in y-direction for composergrid.

Note
this function was added in version 1.4

Definition at line 87 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridIntervalY().

void QgsComposerMapGrid::setGridLineSymbol ( QgsLineSymbolV2 symbol)
void QgsComposerMapGrid::setGridMarkerSymbol ( QgsMarkerSymbolV2 symbol)

Definition at line 1192 of file qgscomposermapgrid.cpp.

References mGridMarkerSymbol.

void QgsComposerMapGrid::setGridOffsetX ( double  offset)
inline

Sets x-coordinate offset for composer grid.

Note
this function was added in version 1.4

Definition at line 92 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridOffsetX().

void QgsComposerMapGrid::setGridOffsetY ( double  offset)
inline

Sets y-coordinate offset for composer grid.

Note
this function was added in version 1.4

Definition at line 97 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridOffsetY().

void QgsComposerMapGrid::setGridPen ( const QPen &  p)

Sets the pen to draw composer grid.

Note
this function was added in version 1.4

Definition at line 132 of file qgscomposermapgrid.cpp.

References setGridPenColor(), and setGridPenWidth().

Referenced by QgsComposerMap::setGridPen().

void QgsComposerMapGrid::setGridPenColor ( const QColor &  c)

Sets the color of the grid pen.

Note
this function was added in version 1.4

Definition at line 124 of file qgscomposermapgrid.cpp.

References mGridLineSymbol, and QgsSymbolV2::setColor().

Referenced by setGridPen(), and QgsComposerMap::setGridPenColor().

void QgsComposerMapGrid::setGridPenWidth ( double  w)

Sets with of grid pen.

Note
this function was added in version 1.4

Definition at line 116 of file qgscomposermapgrid.cpp.

References mGridLineSymbol, and QgsLineSymbolV2::setWidth().

Referenced by setGridPen(), and QgsComposerMap::setGridPenWidth().

void QgsComposerMapGrid::setGridStyle ( QgsComposerMap::GridStyle  style)
inline

Sets coordinate grid style to solid or cross.

Note
this function was added in version 1.4

Definition at line 77 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setGridStyle().

void QgsComposerMapGrid::setGridUnit ( GridUnit  u)
inline

Definition at line 202 of file qgscomposermapgrid.h.

void QgsComposerMapGrid::setName ( const QString &  name)
inline

Definition at line 65 of file qgscomposermapgrid.h.

void QgsComposerMapGrid::setShowGridAnnotation ( bool  show)
inline

Sets flag if grid annotation should be shown.

Note
this function was added in version 1.4

Definition at line 128 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::readXML(), and QgsComposerMap::setShowGridAnnotation().

bool QgsComposerMapGrid::showGridAnnotation ( ) const
inline

Definition at line 129 of file qgscomposermapgrid.h.

Referenced by QgsComposerMap::showGridAnnotation().

void QgsComposerMapGrid::sortGridLinesOnBorders ( const QList< QPair< double, QLineF > > &  hLines,
const QList< QPair< double, QLineF > > &  vLines,
QMap< double, double > &  leftFrameEntries,
QMap< double, double > &  rightFrameEntries,
QMap< double, double > &  topFrameEntries,
QMap< double, double > &  bottomFrameEntries 
) const
private
QPolygonF QgsComposerMapGrid::trimLineToMap ( const QPolygonF &  line,
const QgsRectangle rect 
)
staticprivate
bool QgsComposerMapGrid::writeXML ( QDomElement &  elem,
QDomDocument &  doc 
) const
int QgsComposerMapGrid::xGridLines ( QList< QPair< double, QLineF > > &  lines) const
private
int QgsComposerMapGrid::xGridLinesCRSTransform ( const QgsRectangle bbox,
const QgsCoordinateTransform t,
QList< QPair< double, QPolygonF > > &  lines 
) const
private
int QgsComposerMapGrid::yGridLines ( QList< QPair< double, QLineF > > &  lines) const
private

Returns the grid lines for the y-coordinates.

Not vertical in case of rotation

Returns
0 in case of success

Definition at line 947 of file qgscomposermapgrid.cpp.

References CM, gridIntervalX(), gridOffsetX(), QgsComposerMap::mapRotation(), QgsComposerMap::mapToItemCoords(), MapUnit, MAX_GRID_LINES, mComposerMap, mGridIntervalX, mGridOffsetX, mGridUnit, qgsDoubleNear(), and QgsComposerMap::transformedMapPolygon().

Referenced by drawGridCRSTransform(), drawGridNoTransform(), and maxExtension().

int QgsComposerMapGrid::yGridLinesCRSTransform ( const QgsRectangle bbox,
const QgsCoordinateTransform t,
QList< QPair< double, QPolygonF > > &  lines 
) const
private

Member Data Documentation

double QgsComposerMapGrid::mAnnotationFrameDistance
private

Distance between map frame and annotation.

Definition at line 248 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), maxExtension(), readXML(), and writeXML().

QPainter::CompositionMode QgsComposerMapGrid::mBlendMode
private

Definition at line 274 of file qgscomposermapgrid.h.

Referenced by drawGrid(), readXML(), and writeXML().

QgsComposerMap::GridAnnotationDirection QgsComposerMapGrid::mBottomGridAnnotationDirection
private

Annotation direction on bottom side ( horizontal or vertical )

Definition at line 257 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().

QgsComposerMap::GridAnnotationPosition QgsComposerMapGrid::mBottomGridAnnotationPosition
private

Annotation position for bottom map side (inside / outside / not shown)

Definition at line 245 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().

QgsComposerMap* QgsComposerMapGrid::mComposerMap
private
double QgsComposerMapGrid::mCrossLength
private

Definition at line 265 of file qgscomposermapgrid.h.

Referenced by drawGridNoTransform(), readXML(), and writeXML().

QgsCoordinateReferenceSystem QgsComposerMapGrid::mCRS
private

Definition at line 270 of file qgscomposermapgrid.h.

Referenced by crsGridParams(), drawGrid(), maxExtension(), readXML(), and writeXML().

QFont QgsComposerMapGrid::mGridAnnotationFont
private

Font for grid line annotation.

Definition at line 230 of file qgscomposermapgrid.h.

Referenced by drawAnnotation(), drawCoordinateAnnotation(), maxExtension(), QgsComposerMapGrid(), readXML(), and writeXML().

QColor QgsComposerMapGrid::mGridAnnotationFontColor
private

Font color for grid coordinates.

Definition at line 232 of file qgscomposermapgrid.h.

Referenced by drawAnnotation(), readXML(), and writeXML().

QgsComposerMap::GridAnnotationFormat QgsComposerMapGrid::mGridAnnotationFormat
private

Definition at line 258 of file qgscomposermapgrid.h.

Referenced by gridAnnotationString(), readXML(), and writeXML().

int QgsComposerMapGrid::mGridAnnotationPrecision
private

Digits after the dot.

Definition at line 234 of file qgscomposermapgrid.h.

Referenced by gridAnnotationString(), readXML(), and writeXML().

bool QgsComposerMapGrid::mGridEnabled
private

True if coordinate grid has to be displayed.

Definition at line 218 of file qgscomposermapgrid.h.

Referenced by drawGrid(), drawGridCRSTransform(), maxExtension(), readXML(), and writeXML().

QColor QgsComposerMapGrid::mGridFrameFillColor1
private

Definition at line 263 of file qgscomposermapgrid.h.

Referenced by drawGridFrameBorder(), readXML(), and writeXML().

QColor QgsComposerMapGrid::mGridFrameFillColor2
private

Definition at line 264 of file qgscomposermapgrid.h.

Referenced by drawGridFrameBorder(), readXML(), and writeXML().

QColor QgsComposerMapGrid::mGridFramePenColor
private

Definition at line 262 of file qgscomposermapgrid.h.

Referenced by drawGridFrameBorder(), readXML(), and writeXML().

double QgsComposerMapGrid::mGridFramePenThickness
private

Definition at line 261 of file qgscomposermapgrid.h.

Referenced by drawGridFrameBorder(), maxExtension(), readXML(), and writeXML().

QgsComposerMap::GridFrameStyle QgsComposerMapGrid::mGridFrameStyle
private
double QgsComposerMapGrid::mGridFrameWidth
private
double QgsComposerMapGrid::mGridIntervalX
private

Grid line interval in x-direction (map units)

Definition at line 222 of file qgscomposermapgrid.h.

Referenced by readXML(), writeXML(), yGridLines(), and yGridLinesCRSTransform().

double QgsComposerMapGrid::mGridIntervalY
private

Grid line interval in y-direction (map units)

Definition at line 224 of file qgscomposermapgrid.h.

Referenced by readXML(), writeXML(), xGridLines(), and xGridLinesCRSTransform().

QgsLineSymbolV2* QgsComposerMapGrid::mGridLineSymbol
private
QgsMarkerSymbolV2* QgsComposerMapGrid::mGridMarkerSymbol
private
double QgsComposerMapGrid::mGridOffsetX
private

Grid line offset in x-direction.

Definition at line 226 of file qgscomposermapgrid.h.

Referenced by readXML(), writeXML(), yGridLines(), and yGridLinesCRSTransform().

double QgsComposerMapGrid::mGridOffsetY
private

Grid line offset in y-direction.

Definition at line 228 of file qgscomposermapgrid.h.

Referenced by readXML(), writeXML(), xGridLines(), and xGridLinesCRSTransform().

QgsComposerMap::GridStyle QgsComposerMapGrid::mGridStyle
private

Solid or crosses.

Definition at line 220 of file qgscomposermapgrid.h.

Referenced by drawGridNoTransform(), readXML(), and writeXML().

GridUnit QgsComposerMapGrid::mGridUnit
private

Definition at line 272 of file qgscomposermapgrid.h.

Referenced by drawGrid(), readXML(), writeXML(), xGridLines(), and yGridLines().

QgsComposerMap::GridAnnotationDirection QgsComposerMapGrid::mLeftGridAnnotationDirection
private

Annotation direction on left side ( horizontal or vertical )

Definition at line 251 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().

QgsComposerMap::GridAnnotationPosition QgsComposerMapGrid::mLeftGridAnnotationPosition
private

Annotation position for left map side (inside / outside / not shown)

Definition at line 239 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().

QString QgsComposerMapGrid::mName
private

Definition at line 214 of file qgscomposermapgrid.h.

Referenced by readXML(), and writeXML().

QgsComposerMap::GridAnnotationDirection QgsComposerMapGrid::mRightGridAnnotationDirection
private

Annotation direction on right side ( horizontal or vertical )

Definition at line 253 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().

QgsComposerMap::GridAnnotationPosition QgsComposerMapGrid::mRightGridAnnotationPosition
private

Annotation position for right map side (inside / outside / not shown)

Definition at line 241 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().

bool QgsComposerMapGrid::mShowGridAnnotation
private

True if coordinate values should be drawn.

Definition at line 236 of file qgscomposermapgrid.h.

Referenced by drawGrid(), maxExtension(), readXML(), and writeXML().

QgsComposerMap::GridAnnotationDirection QgsComposerMapGrid::mTopGridAnnotationDirection
private

Annotation direction on top side ( horizontal or vertical )

Definition at line 255 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationDirection(), readXML(), setGridAnnotationDirection(), and writeXML().

QgsComposerMap::GridAnnotationPosition QgsComposerMapGrid::mTopGridAnnotationPosition
private

Annotation position for top map side (inside / outside / not shown)

Definition at line 243 of file qgscomposermapgrid.h.

Referenced by drawCoordinateAnnotation(), gridAnnotationPosition(), maxExtension(), readXML(), setGridAnnotationPosition(), and writeXML().

QString QgsComposerMapGrid::mUuid
private

Definition at line 215 of file qgscomposermapgrid.h.

Referenced by readXML(), and writeXML().


The documentation for this class was generated from the following files: