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 );
136 double maxGridExtension()
const;
218 DegreeMinuteSecondPadded
252 Q_DECLARE_FLAGS( FrameSideFlags, FrameSideFlag )
305 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
311 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
319 double maxExtension()
const;
330 void setUnits(
const GridUnit unit );
345 void setIntervalX(
const double interval );
361 void setIntervalY(
const double interval );
377 void setOffsetX(
const double offset );
385 double offsetX()
const {
return mGridOffsetX; }
393 void setOffsetY(
const double offset );
401 double offsetY()
const {
return mGridOffsetY; }
412 void setStyle(
const GridStyle style );
442 void setGridLineWidth(
const double width );
451 void setGridLineColor(
const QColor& color );
566 void setAnnotationDisplay(
const DisplayMode display,
const BorderSide border );
576 DisplayMode annotationDisplay(
const BorderSide border )
const;
584 void setAnnotationPosition(
const AnnotationPosition position,
const BorderSide border );
592 AnnotationPosition annotationPosition(
const BorderSide border )
const;
611 void setAnnotationDirection(
const AnnotationDirection direction,
const BorderSide border );
617 void setAnnotationDirection(
const AnnotationDirection direction );
624 AnnotationDirection annotationDirection(
const BorderSide border )
const;
660 void setFrameDivisions(
const DisplayMode divisions,
const BorderSide border );
668 DisplayMode frameDivisions(
const BorderSide border )
const;
677 void setFrameSideFlags(
const FrameSideFlags flags );
686 void setFrameSideFlag(
const FrameSideFlag flag,
bool on =
true );
695 FrameSideFlags frameSideFlags()
const;
705 bool testFrameSideFlag(
const FrameSideFlag flag )
const;
792 bool mTransformDirty;
795 GridStyle mGridStyle;
797 double mGridIntervalX;
799 double mGridIntervalY;
805 QFont mGridAnnotationFont;
807 QColor mGridAnnotationFontColor;
809 int mGridAnnotationPrecision;
811 bool mShowGridAnnotation;
814 DisplayMode mLeftGridAnnotationDisplay;
816 DisplayMode mRightGridAnnotationDisplay;
818 DisplayMode mTopGridAnnotationDisplay;
820 DisplayMode mBottomGridAnnotationDisplay;
823 AnnotationPosition mLeftGridAnnotationPosition;
825 AnnotationPosition mRightGridAnnotationPosition;
827 AnnotationPosition mTopGridAnnotationPosition;
829 AnnotationPosition mBottomGridAnnotationPosition;
832 double mAnnotationFrameDistance;
835 AnnotationDirection mLeftGridAnnotationDirection;
837 AnnotationDirection mRightGridAnnotationDirection;
839 AnnotationDirection mTopGridAnnotationDirection;
841 AnnotationDirection mBottomGridAnnotationDirection;
842 AnnotationFormat mGridAnnotationFormat;
843 FrameStyle mGridFrameStyle;
844 FrameSideFlags mGridFrameSides;
845 double mGridFrameWidth;
846 double mGridFramePenThickness;
847 QColor mGridFramePenColor;
848 QColor mGridFrameFillColor1;
849 QColor mGridFrameFillColor2;
853 DisplayMode mLeftFrameDivisions;
855 DisplayMode mRightFrameDivisions;
857 DisplayMode mTopFrameDivisions;
859 DisplayMode mBottomFrameDivisions;
868 QPainter::CompositionMode mBlendMode;
876 class QgsMapAnnotation
895 void drawCoordinateAnnotation(
QPainter* p,
const QPointF& pos,
QString annotationString,
const AnnotationCoordinate coordinateType )
const;
903 void drawAnnotation(
QPainter* p,
const QPointF& pos,
int rotation,
const QString& annotationText )
const;
905 QString gridAnnotationString(
double value, AnnotationCoordinate coord )
const;
932 BorderSide borderForLineCoord(
const QPointF& p,
const AnnotationCoordinate coordinateType )
const;
947 void createDefaultGridLineSymbol();
949 void createDefaultGridMarkerSymbol();
957 void drawGridFrameLineBorder(
QPainter *p, BorderSide border )
const;
959 void calculateCRSTransformLines();
964 friend class TestQgsComposerMapGrid;
967 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsComposerMapGrid::FrameSideFlags )
969 #endif // QGSCOMPOSERMAPGRID_H
QColor frameFillColor1() const
Retrieves the first fill color for the grid frame.
A rectangle specified with double values.
const QgsMarkerSymbolV2 * markerSymbol() const
Gets the marker symbol used for drawing grid points.
double intervalX() const
Gets the interval between grid lines in the x-direction.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blending mode used for drawing the grid.
GridStyle
Grid drawing style.
virtual void draw(QPainter *painter)=0
Draws the item on to a painter.
const QgsLineSymbolV2 * lineSymbol() const
Gets the line symbol used for drawing grid lines.
void setFramePenSize(const double width)
Sets the width of the outline drawn in the grid frame.
A collection of grids which is drawn above the map content in a QgsComposerMap.
FrameStyle
Style for grid frame.
double annotationFrameDistance() const
Gets the distance between the map frame and annotations.
QColor frameFillColor2() const
Retrieves the second fill color for the grid frame.
FrameStyle frameStyle() const
Gets the grid frame style.
void setAnnotationFont(const QFont &font)
Sets the font used for drawing grid annotations.
QColor framePenColor() const
Retrieves the color of the outline drawn in the grid frame.
AnnotationDirection
Direction of grid annotations.
QgsMarkerSymbolV2 * markerSymbol()
Gets the marker symbol used for drawing grid points.
AnnotationFormat annotationFormat() const
Gets the format for drawing grid annotations.
AnnotationFormat
Format for displaying grid annotations.
An item which is drawn inside a QgsComposerMap, eg a grid or map overview.
double intervalY() const
Gets the interval between grid lines in the y-direction.
void setCrossLength(const double length)
Sets the length of the cross segments drawn for the grid.
QFont annotationFont() const
Gets the font used for drawing grid annotations.
QList< QgsComposerMapItem * > asList() const
Returns a list of QgsComposerMapItems contained by the stack.
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 offsetX() const
Gets the offset for grid lines in the x-direction.
void setAnnotationEnabled(const bool enabled)
Sets whether annotations should be shown for the grid.
QgsComposerMapItem & operator[](int idx)
Returns a reference to an item within the stack.
GridStyle style() const
Gets the grid's style, which controls how the grid is drawn over the map's contents.
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.
double offsetY() const
Gets the offset for grid lines in the y-direction.
double framePenSize() const
Retrieves the width of the outline drawn in the grid frame.
GridUnit units() const
Gets the units used for grid measurements such as the interval and offset for grid lines...
void setFrameWidth(const double width)
Sets the grid frame width.
void setAnnotationFontColor(const QColor &color)
Sets the font color used for drawing grid annotations.
Object representing map window.
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.
int annotationPrecision() const
Returns the coordinate precision for grid annotations.
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the grid.
virtual bool enabled() const
Returns whether the item will be drawn.
QColor annotationFontColor() const
Gets the font color used for drawing grid annotations.
Contains information about the context of a rendering operation.
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.
bool annotationEnabled() const
Gets whether annotations are shown for the grid.
double crossLength() const
Retrieves the length of the cross segments drawn for the grid.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc) override
Sets map item state from a DOM document.
virtual bool usesAdvancedEffects() const
Returns true if the item is drawn using advanced effects, such as blend modes.
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.
QgsCoordinateReferenceSystem crs() const
Retrieves the CRS for the grid.
GridUnit
Unit for grid values.
AnnotationCoordinate
Annotation coordinate type.
void setAnnotationFrameDistance(const double distance)
Sets the distance between the map frame and annotations.
double frameWidth() const
Gets the grid frame width.