QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgscomposermapgrid.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposermapgrid.h
3  --------------------
4  begin : December 2013
5  copyright : (C) 2013 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSCOMPOSERMAPGRID_H
19 #define QGSCOMPOSERMAPGRID_H
20 
21 #include "qgscomposermapitem.h"
23 #include "qgsrectangle.h"
24 #include "qgsrendercontext.h"
25 #include <QString>
26 #include <QPainter>
27 
29 class QgsLineSymbolV2;
30 class QgsMarkerSymbolV2;
31 class QgsComposerMapGrid;
32 class QgsComposerMap;
33 class QDomDocument;
34 class QDomElement;
35 class QPainter;
36 
46 {
47  public:
48 
53 
54  virtual ~QgsComposerMapGridStack();
55 
64  void addGrid( QgsComposerMapGrid* grid );
65 
72  void removeGrid( const QString& gridId );
73 
80  void moveGridUp( const QString& gridId );
81 
88  void moveGridDown( const QString& gridId );
89 
95  const QgsComposerMapGrid* constGrid( const QString& gridId ) const;
96 
102  QgsComposerMapGrid* grid( const QString& gridId ) const;
103 
109  QgsComposerMapGrid* grid( const int index ) const;
110 
117  QgsComposerMapGrid &operator[]( int idx );
118 
122  QList< QgsComposerMapGrid* > asList() const;
123 
130  bool readXML( const QDomElement& elem, const QDomDocument& doc );
131 
136  double maxGridExtension() const;
137 
138 };
139 
140 //
141 // QgsComposerMapGrid
142 //
143 
151 class CORE_EXPORT QgsComposerMapGrid : public QgsComposerMapItem
152 {
153 
154  Q_OBJECT
155 
156  public:
157 
160  enum GridUnit
161  {
162  MapUnit, /*< grid units follow map units */
163  MM, /*< grid units in millimetres */
164  CM /*< grid units in centimetres */
165  };
166 
170  {
171  Solid = 0,
172  Cross, /*< draw line crosses at intersections of grid lines */
173  Markers, /*< draw markers at intersections of grid lines */
174  FrameAnnotationsOnly /*< no grid lines over the map, only draw frame and annotations */
175  };
176 
180  {
181  InsideMapFrame = 0,
182  OutsideMapFrame, /*< draw annotations outside the map frame */
183  Disabled /*< disable annotation */
184  };
185 
189  {
190  Horizontal = 0, /*< draw annotations horizontally */
191  Vertical, /*< draw annotations vertically */
192  BoundaryDirection /*< annotations follow the boundary direction */
193  };
194 
198  {
199  Decimal = 0, /*< decimal degrees, use - for S/W coordinates */
200  DegreeMinute, /*< degree/minutes, use NSEW suffix */
201  DegreeMinuteSecond, /*< degree/minutes/seconds, use NSEW suffix */
202  DecimalWithSuffix, /*< decimal degrees, use NSEW suffix */
203  DegreeMinuteNoSuffix, /*< degree/minutes, use - for S/W coordinates */
204  DegreeMinutePadded, /*< degree/minutes, with minutes using leading zeros were required */
205  DegreeMinuteSecondNoSuffix, /*< degree/minutes/seconds, use - for S/W coordinates */
206  DegreeMinuteSecondPadded /*< degree/minutes/seconds, with minutes using leading zeros were required */
207  };
208 
212  {
214  Right, /*< right border */
215  Bottom, /*< bottom border */
216  Top /*< top border */
217  };
218 
222  {
223  NoFrame = 0, /*< disable grid frame */
224  Zebra, /*< black/white pattern */
225  InteriorTicks, /*< tick markers drawn inside map frame */
226  ExteriorTicks, /*< tick markers drawn outside map frame */
227  InteriorExteriorTicks, /*< tick markers drawn both inside and outside the map frame */
228  LineBorder /*< simple solid line frame */
229  };
230 
234  {
235  FrameLeft = 0x01, /*< left side of map */
236  FrameRight = 0x02, /*< right side of map */
237  FrameTop = 0x04, /*< top side of map */
238  FrameBottom = 0x08 /*< bottom side of map */
239  };
240  Q_DECLARE_FLAGS( FrameSideFlags, FrameSideFlag )
241 
242 
245  {
246  Longitude = 0, /*< coordinate is a longitude value */
247  Latitude /*< coordinate is a latitude value */
248  };
249 
254  QgsComposerMapGrid( const QString& name, QgsComposerMap* map );
255 
256  virtual ~QgsComposerMapGrid();
257 
261  void draw( QPainter* painter ) const;
262 
268  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
269 
275  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
276 
281  void setCrs( const QgsCoordinateReferenceSystem& crs ) { mCRS = crs; }
282 
287  QgsCoordinateReferenceSystem crs() const { return mCRS; }
288 
293  void setBlendMode( const QPainter::CompositionMode mode ) { mBlendMode = mode; }
294 
299  QPainter::CompositionMode blendMode() const { return mBlendMode; }
300 
301  bool usesAdvancedEffects() const;
302 
307  double maxExtension() const;
308 
309  //
310  // GRID UNITS
311  //
312 
318  void setUnits( const GridUnit unit ) { mGridUnit = unit; }
319 
325  GridUnit units() const { return mGridUnit; }
326 
333  void setIntervalX( const double interval ) { mGridIntervalX = interval; }
334 
341  double intervalX() const { return mGridIntervalX; }
342 
349  void setIntervalY( const double interval ) { mGridIntervalY = interval; }
350 
357  double intervalY() const { return mGridIntervalY; }
358 
365  void setOffsetX( const double offset ) { mGridOffsetX = offset; }
366 
373  double offsetX() const { return mGridOffsetX; }
374 
381  void setOffsetY( const double offset ) { mGridOffsetY = offset; }
382 
389  double offsetY() const { return mGridOffsetY; }
390 
391  //
392  // GRID APPEARANCE
393  //
394 
400  void setStyle( const GridStyle style ) { mGridStyle = style; }
401 
407  GridStyle style() const { return mGridStyle; }
408 
414  void setCrossLength( const double length ) { mCrossLength = length; }
415 
421  double crossLength() const { return mCrossLength; }
422 
430  void setGridLineWidth( const double width );
431 
439  void setGridLineColor( const QColor& color );
440 
448  void setLineSymbol( QgsLineSymbolV2* symbol );
449 
457  const QgsLineSymbolV2* lineSymbol() const { return mGridLineSymbol; }
458 
466  QgsLineSymbolV2* lineSymbol() { return mGridLineSymbol; }
467 
475  void setMarkerSymbol( QgsMarkerSymbolV2* symbol );
476 
484  const QgsMarkerSymbolV2* markerSymbol() const { return mGridMarkerSymbol; }
485 
493  QgsMarkerSymbolV2* markerSymbol() { return mGridMarkerSymbol; }
494 
495  //
496  // ANNOTATIONS
497  //
498 
503  void setAnnotationEnabled( const bool enabled ) { mShowGridAnnotation = enabled; }
504 
509  bool annotationEnabled() const { return mShowGridAnnotation; }
510 
515  void setAnnotationFont( const QFont& font ) { mGridAnnotationFont = font; }
516 
521  QFont annotationFont() const { return mGridAnnotationFont; }
522 
527  void setAnnotationFontColor( const QColor& color ) { mGridAnnotationFontColor = color; }
528 
533  QColor annotationFontColor() const { return mGridAnnotationFontColor; }
534 
539  void setAnnotationPrecision( const int precision ) { mGridAnnotationPrecision = precision; }
540 
545  int annotationPrecision() const { return mGridAnnotationPrecision; }
546 
553  void setAnnotationPosition( const AnnotationPosition position, const BorderSide border );
554 
561  AnnotationPosition annotationPosition( const BorderSide border ) const;
562 
567  void setAnnotationFrameDistance( const double distance ) { mAnnotationFrameDistance = distance; }
568 
573  double annotationFrameDistance() const { return mAnnotationFrameDistance; }
574 
580  void setAnnotationDirection( const AnnotationDirection direction, const BorderSide border );
581 
586  void setAnnotationDirection( const AnnotationDirection direction );
587 
593  AnnotationDirection annotationDirection( const BorderSide border ) const;
594 
599  void setAnnotationFormat( const AnnotationFormat format ) { mGridAnnotationFormat = format; }
600 
605  AnnotationFormat annotationFormat() const { return mGridAnnotationFormat; }
606 
607  //
608  // GRID FRAME
609  //
610 
615  void setFrameStyle( const FrameStyle style ) { mGridFrameStyle = style; }
616 
621  FrameStyle frameStyle() const { return mGridFrameStyle; }
622 
630  void setFrameSideFlags( const FrameSideFlags flags );
631 
639  void setFrameSideFlag( const FrameSideFlag flag, bool on = true );
640 
648  FrameSideFlags frameSideFlags() const;
649 
658  bool testFrameSideFlag( const FrameSideFlag flag ) const;
659 
666  void setFrameWidth( const double width ) { mGridFrameWidth = width; }
667 
674  double frameWidth() const { return mGridFrameWidth; }
675 
681  void setFramePenSize( const double width ) { mGridFramePenThickness = width; }
682 
688  double framePenSize() const { return mGridFramePenThickness; }
689 
697  void setFramePenColor( const QColor& color ) { mGridFramePenColor = color; }
698 
706  QColor framePenColor() const {return mGridFramePenColor;}
707 
714  void setFrameFillColor1( const QColor& color ) { mGridFrameFillColor1 = color; }
715 
722  QColor frameFillColor1() const { return mGridFrameFillColor1; }
723 
730  void setFrameFillColor2( const QColor& color ) { mGridFrameFillColor2 = color; }
731 
738  QColor frameFillColor2() const { return mGridFrameFillColor2; }
739 
740  private:
741 
742  QgsComposerMapGrid(); //forbidden
743 
745  GridStyle mGridStyle;
747  double mGridIntervalX;
749  double mGridIntervalY;
751  double mGridOffsetX;
753  double mGridOffsetY;
755  QFont mGridAnnotationFont;
757  QColor mGridAnnotationFontColor;
759  int mGridAnnotationPrecision;
761  bool mShowGridAnnotation;
762 
764  AnnotationPosition mLeftGridAnnotationPosition;
766  AnnotationPosition mRightGridAnnotationPosition;
768  AnnotationPosition mTopGridAnnotationPosition;
770  AnnotationPosition mBottomGridAnnotationPosition;
771 
773  double mAnnotationFrameDistance;
774 
776  AnnotationDirection mLeftGridAnnotationDirection;
778  AnnotationDirection mRightGridAnnotationDirection;
780  AnnotationDirection mTopGridAnnotationDirection;
782  AnnotationDirection mBottomGridAnnotationDirection;
783  AnnotationFormat mGridAnnotationFormat;
784  FrameStyle mGridFrameStyle;
785  FrameSideFlags mGridFrameSides;
786  double mGridFrameWidth;
787  double mGridFramePenThickness;
788  QColor mGridFramePenColor;
789  QColor mGridFrameFillColor1;
790  QColor mGridFrameFillColor2;
791  double mCrossLength;
792 
793  QgsLineSymbolV2* mGridLineSymbol;
794  QgsMarkerSymbolV2* mGridMarkerSymbol;
795 
797 
798  GridUnit mGridUnit;
799 
800  QPainter::CompositionMode mBlendMode;
801 
803  void drawGridFrame( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines ) const;
804 
809  void drawCoordinateAnnotations( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines ) const;
810 
811  void drawCoordinateAnnotation( QPainter* p, const QPointF& pos, QString annotationString ) const;
812 
818  void drawAnnotation( QPainter* p, const QPointF& pos, int rotation, const QString& annotationText ) const;
819 
820  QString gridAnnotationString( double value, AnnotationCoordinate coord ) const;
821 
824  int xGridLines( QList< QPair< double, QLineF > >& lines ) const;
825 
828  int yGridLines( QList< QPair< double, QLineF > >& lines ) const;
829 
830  int xGridLinesCRSTransform( const QgsRectangle& bbox, const QgsCoordinateTransform& t, QList< QPair< double, QPolygonF > >& lines ) const;
831 
832  int yGridLinesCRSTransform( const QgsRectangle& bbox, const QgsCoordinateTransform& t, QList< QPair< double, QPolygonF > >& lines ) const;
833 
834  void drawGridLine( const QLineF& line, QgsRenderContext &context ) const;
835 
836  void drawGridLine( const QPolygonF& line, QgsRenderContext &context ) const;
837 
838  void sortGridLinesOnBorders( const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines, QMap< double, double >& leftFrameEntries,
839  QMap< double, double >& rightFrameEntries, QMap< double, double >& topFrameEntries, QMap< double, double >& bottomFrameEntries ) const;
840 
841  void drawGridFrameBorder( QPainter* p, const QMap< double, double >& borderPos, BorderSide border ) const;
842 
844  BorderSide borderForLineCoord( const QPointF& p ) const;
845 
847  int crsGridParams( QgsRectangle& crsRect, QgsCoordinateTransform& inverseTransform ) const;
848 
849  static QPolygonF trimLineToMap( const QPolygonF& line, const QgsRectangle& rect );
850 
851  QPolygonF scalePolygon( const QPolygonF &polygon, const double scale ) const;
852 
854  void drawGridCRSTransform( QgsRenderContext &context , double dotsPerMM, QList< QPair< double, QLineF > > &horizontalLines,
855  QList< QPair< double, QLineF > > &verticalLines ) const;
856 
857  void drawGridNoTransform( QgsRenderContext &context, double dotsPerMM, QList<QPair<double, QLineF> > &horizontalLines, QList<QPair<double, QLineF> > &verticalLines ) const;
858 
859  void createDefaultGridLineSymbol();
860 
861  void createDefaultGridMarkerSymbol();
862 
863  void drawGridMarker( const QPointF &point, QgsRenderContext &context ) const;
864 
865  void drawGridFrameZebraBorder( QPainter *p, const QMap<double, double> &borderPos, BorderSide border ) const;
866 
867  void drawGridFrameTicks( QPainter *p, const QMap<double, double> &borderPos, BorderSide border ) const;
868 
869  void drawGridFrameLineBorder( QPainter *p, BorderSide border ) const;
870 
871 };
872 
873 #endif // QGSCOMPOSERMAPGRID_H
void setStyle(const GridStyle style)
Sets the grid style, which controls how the grid is drawn over the map's contents.
Definition: qgscomposermapgrid.h:400
QColor frameFillColor1() const
Retrieves the first fill color for the grid frame.
Definition: qgscomposermapgrid.h:722
static unsigned index
Definition: mersenne-twister.cpp:36
A rectangle specified with double values.
Definition: qgsrectangle.h:35
const QgsMarkerSymbolV2 * markerSymbol() const
Gets the marker symbol used for drawing grid points.
Definition: qgscomposermapgrid.h:484
double intervalX() const
Gets the interval between grid lines in the x-direction.
Definition: qgscomposermapgrid.h:341
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blending mode used for drawing the grid.
Definition: qgscomposermapgrid.h:293
GridStyle
Grid drawing style.
Definition: qgscomposermapgrid.h:169
void setOffsetY(const double offset)
Sets the offset for grid lines in the y-direction.
Definition: qgscomposermapgrid.h:381
Definition: qgscomposermapgrid.h:172
const QgsLineSymbolV2 * lineSymbol() const
Gets the line symbol used for drawing grid lines.
Definition: qgscomposermapgrid.h:457
void setFramePenSize(const double width)
Sets the width of the outline drawn in the grid frame.
Definition: qgscomposermapgrid.h:681
Definition: qgscomposermapgrid.h:204
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets map item state from a DOM document.
Definition: qgscomposermapitem.cpp:46
A collection of grids which is drawn above the map content in a QgsComposerMap.
Definition: qgscomposermapgrid.h:45
FrameStyle
Style for grid frame.
Definition: qgscomposermapgrid.h:221
double annotationFrameDistance() const
Gets the distance between the map frame and annotations.
Definition: qgscomposermapgrid.h:573
QColor frameFillColor2() const
Retrieves the second fill color for the grid frame.
Definition: qgscomposermapgrid.h:738
Definition: qgscomposermapgrid.h:182
FrameStyle frameStyle() const
Gets the grid frame style.
Definition: qgscomposermapgrid.h:621
Definition: qgscomposermapgrid.h:226
void setAnnotationFont(const QFont &font)
Sets the font used for drawing grid annotations.
Definition: qgscomposermapgrid.h:515
Definition: qgscomposermapgrid.h:200
QColor framePenColor() const
Retrieves the color of the outline drawn in the grid frame.
Definition: qgscomposermapgrid.h:706
AnnotationDirection
Direction of grid annotations.
Definition: qgscomposermapgrid.h:188
QgsMarkerSymbolV2 * markerSymbol()
Gets the marker symbol used for drawing grid points.
Definition: qgscomposermapgrid.h:493
AnnotationFormat annotationFormat() const
Gets the format for drawing grid annotations.
Definition: qgscomposermapgrid.h:605
AnnotationFormat
Format for displaying grid annotations.
Definition: qgscomposermapgrid.h:197
An item which is drawn inside a QgsComposerMap, eg a grid or map overview.
Definition: qgscomposermapitem.h:29
double intervalY() const
Gets the interval between grid lines in the y-direction.
Definition: qgscomposermapgrid.h:357
void setCrossLength(const double length)
Sets the length of the cross segments drawn for the grid.
Definition: qgscomposermapgrid.h:414
QFont annotationFont() const
Gets the font used for drawing grid annotations.
Definition: qgscomposermapgrid.h:521
Definition: qgscomposermapgrid.h:224
Definition: qgscomposermapgrid.h:214
QList< QgsComposerMapItem * > asList() const
Returns a list of QgsComposerMapItems contained by the stack.
Definition: qgscomposermapitem.cpp:167
Definition: qgssymbolv2.h:256
Definition: qgscomposermapgrid.h:215
void setAnnotationFormat(const AnnotationFormat format)
Sets the format for drawing grid annotations.
Definition: qgscomposermapgrid.h:599
AnnotationPosition
Position for grid annotations.
Definition: qgscomposermapgrid.h:179
void setUnits(const GridUnit unit)
Sets the units to use for grid measurements such as the interval and offset for grid lines...
Definition: qgscomposermapgrid.h:318
double offsetX() const
Gets the offset for grid lines in the x-direction.
Definition: qgscomposermapgrid.h:373
Definition: qgscomposermapgrid.h:163
void setAnnotationEnabled(const bool enabled)
Sets whether annotations should be shown for the grid.
Definition: qgscomposermapgrid.h:503
QgsComposerMapItem & operator[](int idx)
Returns a reference to an item within the stack.
Definition: qgscomposermapitem.cpp:162
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores map item state in DOM element.
Definition: qgscomposermapitem.cpp:37
GridStyle style() const
Gets the grid's style, which controls how the grid is drawn over the map's contents.
Definition: qgscomposermapgrid.h:407
FrameSideFlag
Flags for controlling which side of the map a frame is drawn on.
Definition: qgscomposermapgrid.h:233
Definition: qgscomposermapgrid.h:202
An individual grid which is drawn above the map content in a QgsComposerMap.
Definition: qgscomposermapgrid.h:151
QgsLineSymbolV2 * lineSymbol()
Gets the line symbol used for drawing grid lines.
Definition: qgscomposermapgrid.h:466
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the CRS for the grid.
Definition: qgscomposermapgrid.h:281
double offsetY() const
Gets the offset for grid lines in the y-direction.
Definition: qgscomposermapgrid.h:389
double framePenSize() const
Retrieves the width of the outline drawn in the grid frame.
Definition: qgscomposermapgrid.h:688
GridUnit units() const
Gets the units used for grid measurements such as the interval and offset for grid lines...
Definition: qgscomposermapgrid.h:325
void setFrameWidth(const double width)
Sets the grid frame width.
Definition: qgscomposermapgrid.h:666
void setAnnotationFontColor(const QColor &color)
Sets the font color used for drawing grid annotations.
Definition: qgscomposermapgrid.h:527
Object representing map window.
Definition: qgscomposermap.h:46
BorderSide
Border sides for annotations.
Definition: qgscomposermapgrid.h:211
void setFrameFillColor1(const QColor &color)
Sets the first fill color used for the grid frame.
Definition: qgscomposermapgrid.h:714
void setFramePenColor(const QColor &color)
Sets the color of the outline drawn in the grid frame.
Definition: qgscomposermapgrid.h:697
Definition: qgscomposermapgrid.h:201
int annotationPrecision() const
Returns the coordinate precision for grid annotations.
Definition: qgscomposermapgrid.h:545
Definition: qgssymbolv2.h:229
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the grid.
Definition: qgscomposermapgrid.h:299
Definition: qgscomposermapgrid.h:213
virtual bool enabled() const
Returns whether the item will be drawn.
Definition: qgscomposermapitem.h:101
QColor annotationFontColor() const
Gets the font color used for drawing grid annotations.
Definition: qgscomposermapgrid.h:533
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:39
A collection of map items which are drawn above the map content in a QgsComposerMap.
Definition: qgscomposermapitem.h:134
Class for storing a coordinate reference system (CRS)
Definition: qgscoordinatereferencesystem.h:50
void setAnnotationPrecision(const int precision)
Sets the coordinate precision for grid annotations.
Definition: qgscomposermapgrid.h:539
void setIntervalY(const double interval)
Sets the interval between grid lines in the y-direction.
Definition: qgscomposermapgrid.h:349
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:52
bool annotationEnabled() const
Gets whether annotations are shown for the grid.
Definition: qgscomposermapgrid.h:509
Definition: qgscomposermapgrid.h:227
Definition: qgscomposermapgrid.h:203
double crossLength() const
Retrieves the length of the cross segments drawn for the grid.
Definition: qgscomposermapgrid.h:421
virtual bool usesAdvancedEffects() const
Returns true if the item is drawn using advanced effects, such as blend modes.
Definition: qgscomposermapitem.h:106
virtual void draw(QPainter *painter) const =0
Draws the item on to a painter.
Definition: qgscomposermapgrid.h:173
void setFrameFillColor2(const QColor &color)
Sets the second fill color used for the grid frame.
Definition: qgscomposermapgrid.h:730
void setFrameStyle(const FrameStyle style)
Sets the grid frame style.
Definition: qgscomposermapgrid.h:615
Definition: qgscomposermapgrid.h:191
Definition: qgscomposermapgrid.h:205
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.
Definition: qgscomposermapgrid.h:287
GridUnit
Unit for grid values.
Definition: qgscomposermapgrid.h:160
void setIntervalX(const double interval)
Sets the interval between grid lines in the x-direction.
Definition: qgscomposermapgrid.h:333
Definition: qgscomposermapgrid.h:162
void setOffsetX(const double offset)
Sets the offset for grid lines in the x-direction.
Definition: qgscomposermapgrid.h:365
AnnotationCoordinate
Annotation coordinate type.
Definition: qgscomposermapgrid.h:244
void setAnnotationFrameDistance(const double distance)
Sets the distance between the map frame and annotations.
Definition: qgscomposermapgrid.h:567
Definition: qgscomposermapgrid.h:225
double frameWidth() const
Gets the grid frame width.
Definition: qgscomposermapgrid.h:674