18 #ifndef QGSCOMPOSERMAPGRID_H 19 #define QGSCOMPOSERMAPGRID_H 72 void removeGrid(
const QString& gridId );
80 void moveGridUp(
const QString& gridId );
88 void moveGridDown(
const QString& gridId );
137 double maxGridExtension()
const;
149 void calculateMaxGridExtension(
double& top,
double& right,
double& bottom,
double& left )
const;
318 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
324 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
332 double maxExtension();
344 void calculateMaxExtension(
double& top,
double& right,
double& bottom,
double& left );
355 void setUnits(
const GridUnit unit );
370 void setIntervalX(
const double interval );
386 void setIntervalY(
const double interval );
402 void setOffsetX(
const double offset );
410 double offsetX()
const {
return mGridOffsetX; }
418 void setOffsetY(
const double offset );
426 double offsetY()
const {
return mGridOffsetY; }
467 void setGridLineWidth(
const double width );
476 void setGridLineColor(
const QColor& color );
720 void setFrameSideFlags(
const FrameSideFlags& flags );
729 void setFrameSideFlag(
const FrameSideFlag flag,
bool on =
true );
738 FrameSideFlags frameSideFlags()
const;
851 bool mTransformDirty;
856 double mGridIntervalX;
858 double mGridIntervalY;
864 QFont mGridAnnotationFont;
866 QColor mGridAnnotationFontColor;
868 int mGridAnnotationPrecision;
870 bool mShowGridAnnotation;
891 double mAnnotationFrameDistance;
903 QString mGridAnnotationExpressionString;
907 FrameSideFlags mGridFrameSides;
908 double mGridFrameWidth;
909 double mGridFramePenThickness;
910 QColor mGridFramePenColor;
911 QColor mGridFrameFillColor1;
912 QColor mGridFrameFillColor2;
931 QPainter::CompositionMode mBlendMode;
939 class QgsMapAnnotation
1022 void createDefaultGridLineSymbol();
1024 void createDefaultGridMarkerSymbol();
1032 void drawGridFrameLineBorder(
QPainter *p,
BorderSide border,
double* extension =
nullptr )
const;
1034 void calculateCRSTransformLines();
1039 friend class TestQgsComposerMapGrid;
1042 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsComposerMapGrid::FrameSideFlags )
1044 #endif // QGSCOMPOSERMAPGRID_H
QColor annotationFontColor() const
Gets the font color used for drawing grid annotations.
A rectangle specified with double values.
QFont annotationFont() const
Gets the font used for drawing grid annotations.
const QgsLineSymbolV2 * lineSymbol() const
Gets the line symbol used for drawing grid lines.
QColor frameFillColor2() const
Retrieves the second fill color for the grid frame.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blending mode used for drawing the grid.
double intervalY() const
Gets the interval between grid lines in the y-direction.
GridStyle
Grid drawing style.
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the grid.
virtual void draw(QPainter *painter)=0
Draws the item on to a painter.
void setFramePenSize(const double width)
Sets the width of the outline drawn in the grid frame.
QString annotationExpression() const
Returns the expression used for drawing grid annotations.
A collection of grids which is drawn above the map content in a QgsComposerMap.
FrameStyle
Style for grid frame.
QColor frameFillColor1() const
Retrieves the first fill color for the grid frame.
void setAnnotationExpression(const QString &expression)
Sets the expression used for drawing grid annotations.
double intervalX() const
Gets the interval between grid lines in the x-direction.
void setAnnotationFont(const QFont &font)
Sets the font used for drawing grid annotations.
AnnotationDirection
Direction of grid annotations.
QColor framePenColor() const
Retrieves the color of the outline drawn in the grid frame.
double crossLength() const
Retrieves the length of the cross segments drawn for the grid.
QgsMarkerSymbolV2 * markerSymbol()
Gets the marker symbol used for drawing grid points.
AnnotationFormat
Format for displaying grid annotations.
An item which is drawn inside a QgsComposerMap, eg a grid or map overview.
void setCrossLength(const double length)
Sets the length of the cross segments drawn for the grid.
virtual bool enabled() const
Returns whether the item will be drawn.
virtual bool usesAdvancedEffects() const
Returns true if the item is drawn using advanced effects, such as blend modes.
double offsetY() const
Gets the offset for grid lines in the y-direction.
FrameStyle frameStyle() const
Gets the grid frame style.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
DisplayMode
Display settings for grid annotations and frames.
void setAnnotationFormat(const AnnotationFormat format)
Sets the format for drawing grid annotations.
AnnotationPosition
Position for grid annotations.
double frameWidth() const
Gets the grid frame width.
void setAnnotationEnabled(const bool enabled)
Sets whether annotations should be shown for the grid.
GridStyle style() const
Gets the grid's style, which controls how the grid is drawn over the map's contents.
QgsComposerMapItem & operator[](int idx)
Returns a reference to an item within the stack.
FrameSideFlag
Flags for controlling which side of the map a frame is drawn on.
An individual grid which is drawn above the map content in a QgsComposerMap.
QgsLineSymbolV2 * lineSymbol()
Gets the line symbol used for drawing grid lines.
void setFrameWidth(const double width)
Sets the grid frame width.
bool annotationEnabled() const
Gets whether annotations are shown for the grid.
void setAnnotationFontColor(const QColor &color)
Sets the font color used for drawing grid annotations.
int annotationPrecision() const
Returns the coordinate precision for grid annotations.
Object representing map window.
QList< QgsComposerMapItem *> asList() const
Returns a list of QgsComposerMapItems contained by the stack.
BorderSide
Border sides for annotations.
void setFrameFillColor1(const QColor &color)
Sets the first fill color used for the grid frame.
void setFramePenColor(const QColor &color)
Sets the color of the outline drawn in the grid frame.
double annotationFrameDistance() const
Gets the distance between the map frame and annotations.
double offsetX() const
Gets the offset for grid lines in the x-direction.
Contains information about the context of a rendering operation.
AnnotationFormat annotationFormat() const
Gets the format for drawing grid annotations.
A collection of map items which are drawn above the map content in a QgsComposerMap.
Class for storing a coordinate reference system (CRS)
void setAnnotationPrecision(const int precision)
Sets the coordinate precision for grid annotations.
GridUnit units() const
Gets the units used for grid measurements such as the interval and offset for grid lines...
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc) override
Sets map item state from a DOM document.
const QgsMarkerSymbolV2 * markerSymbol() const
Gets the marker symbol used for drawing grid points.
void setFrameFillColor2(const QColor &color)
Sets the second fill color used for the grid frame.
void setFrameStyle(const FrameStyle style)
Sets the grid frame style.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const override
Stores map item state in DOM element.
virtual bool readXML(const QDomElement &elem, const QDomDocument &doc)=0
Sets the item stack's state from a DOM document.
GridUnit
Unit for grid values.
QgsCoordinateReferenceSystem crs() const
Retrieves the CRS for the grid.
AnnotationCoordinate
Annotation coordinate type.
virtual QgsExpressionContext * createExpressionContext() const
Creates an expression context relating to the objects' current state.
double framePenSize() const
Retrieves the width of the outline drawn in the grid frame.
void setAnnotationFrameDistance(const double distance)
Sets the distance between the map frame and annotations.