QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgssymbollayerv2.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollayerv2.h
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSSYMBOLLAYERV2_H
16 #define QGSSYMBOLLAYERV2_H
17 
18 // MSVC compiler doesn't have defined M_PI in math.h
19 #ifndef M_PI
20 #define M_PI 3.14159265358979323846
21 #endif
22 
23 #define DEG2RAD(x) ((x)*M_PI/180)
24 #define DEFAULT_SCALE_METHOD QgsSymbolV2::ScaleDiameter
25 
26 #include <QColor>
27 #include <QMap>
28 #include <QPointF>
29 #include <QSet>
30 #include <QDomDocument>
31 #include <QDomElement>
32 
33 #include "qgssymbolv2.h"
34 #include "qgssymbollayerv2utils.h" // QgsStringMap
35 #include "qgsfield.h"
36 
37 class QPainter;
38 class QSize;
39 class QPolygonF;
40 
41 class QgsDxfExport;
42 class QgsExpression;
43 class QgsDataDefined;
44 class QgsRenderContext;
45 class QgsPaintEffect;
46 
50 class CORE_EXPORT QgsSymbolLayerV2
51 {
52  public:
53 
54  virtual ~QgsSymbolLayerV2();
55 
59  virtual QColor color() const { return mColor; }
63  virtual void setColor( const QColor& color ) { mColor = color; }
64 
67  virtual void setOutlineColor( const QColor& color ) { Q_UNUSED( color ); }
68 
71  virtual QColor outlineColor() const { return QColor(); }
72 
75  virtual void setFillColor( const QColor& color ) { Q_UNUSED( color ); }
76 
79  virtual QColor fillColor() const { return QColor(); }
80 
85  virtual QString layerType() const = 0;
86 
87  virtual void startRender( QgsSymbolV2RenderContext& context ) = 0;
88  virtual void stopRender( QgsSymbolV2RenderContext& context ) = 0;
89 
93  virtual QgsSymbolLayerV2* clone() const = 0;
94 
96  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const
97  { Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
98 
99  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor ); return QString(); }
100 
106  virtual QgsStringMap properties() const = 0;
107 
108  virtual void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) = 0;
109 
110  virtual QgsSymbolV2* subSymbol() { return nullptr; }
112  virtual bool setSubSymbol( QgsSymbolV2* symbol ) { delete symbol; return false; }
113 
114  QgsSymbolV2::SymbolType type() const { return mType; }
115 
117  virtual bool isCompatibleWithSymbol( QgsSymbolV2* symbol ) const;
118 
119  void setLocked( bool locked ) { mLocked = locked; }
120  bool isLocked() const { return mLocked; }
121 
126  virtual double estimateMaxBleed() const { return 0; }
127 
128  virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); }
130 
131  virtual void setMapUnitScale( const QgsMapUnitScale& scale ) { Q_UNUSED( scale ); }
132  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
133 
134  // used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
135  void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
136  int renderingPass() const { return mRenderingPass; }
137 
141  virtual QSet<QString> usedAttributes() const;
142 
146  Q_DECL_DEPRECATED virtual const QgsExpression* dataDefinedProperty( const QString& property ) const;
147 
151  Q_DECL_DEPRECATED virtual QString dataDefinedPropertyString( const QString& property ) const;
152 
156  Q_DECL_DEPRECATED virtual void setDataDefinedProperty( const QString& property, const QString& expressionString );
157 
166  virtual QgsDataDefined* getDataDefinedProperty( const QString& property ) const;
167 
175  virtual void setDataDefinedProperty( const QString& property, QgsDataDefined* dataDefined );
176 
184  virtual void removeDataDefinedProperty( const QString& property );
185 
191  virtual void removeDataDefinedProperties();
192 
197  virtual bool hasDataDefinedProperties() const;
198 
208  virtual bool hasDataDefinedProperty( const QString& property ) const;
209 
225  Q_DECL_DEPRECATED virtual QVariant evaluateDataDefinedProperty( const QString& property, const QgsFeature* feature, const QVariant& defaultVal = QVariant(), bool *ok = nullptr ) const;
226 
240  virtual QVariant evaluateDataDefinedProperty( const QString& property, const QgsSymbolV2RenderContext& context, const QVariant& defaultVal = QVariant(), bool *ok = nullptr ) const;
241 
243  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
244 
246  virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const;
247 
249  virtual double dxfOffset( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const;
250 
252  virtual QColor dxfColor( QgsSymbolV2RenderContext& context ) const;
253 
255  virtual double dxfAngle( QgsSymbolV2RenderContext& context ) const;
256 
258  virtual QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& unit ) const;
259 
261  virtual Qt::PenStyle dxfPenStyle() const;
262 
264  virtual QColor dxfBrushColor( QgsSymbolV2RenderContext& context ) const;
265 
267  virtual Qt::BrushStyle dxfBrushStyle() const;
268 
274  QgsPaintEffect* paintEffect() const;
275 
281  void setPaintEffect( QgsPaintEffect* effect );
282 
283  protected:
284  QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false );
285 
287  bool mLocked;
290 
294 
295  // Configuration of selected symbology implementation
296  static const bool selectionIsOpaque = true; // Selection ignores symbol alpha
297  static const bool selectFillBorder = false; // Fill symbol layer also selects border symbology
298  static const bool selectFillStyle = false; // Fill symbol uses symbol layer style..
299 
306  Q_DECL_DEPRECATED virtual void prepareExpressions( const QgsFields* fields, double scale = -1.0 );
307 
313  virtual void prepareExpressions( const QgsSymbolV2RenderContext& context );
314 
318  Q_DECL_DEPRECATED virtual QgsExpression* expression( const QString& property ) const;
319 
324  void saveDataDefinedProperties( QgsStringMap& stringMap ) const;
325 
331  void restoreDataDefinedProperties( const QgsStringMap& stringMap );
332 
336  void copyDataDefinedProperties( QgsSymbolLayerV2* destLayer ) const;
337 
342  void copyPaintEffect( QgsSymbolLayerV2* destLayer ) const;
343 
344  static const QString EXPR_SIZE;
345  static const QString EXPR_ANGLE;
346  static const QString EXPR_NAME;
347  static const QString EXPR_COLOR;
351  static const QString EXPR_FILL;
352  static const QString EXPR_OUTLINE;
353  static const QString EXPR_OFFSET;
354  static const QString EXPR_CHAR;
355  static const QString EXPR_FILL_COLOR;
357  static const QString EXPR_WIDTH;
358  static const QString EXPR_HEIGHT;
359  static const QString EXPR_SYMBOL_NAME;
360  static const QString EXPR_ROTATION;
361  static const QString EXPR_FILL_STYLE;
364  static const QString EXPR_JOIN_STYLE;
366  static const QString EXPR_COLOR2;
367  static const QString EXPR_LINEANGLE;
370  static const QString EXPR_SPREAD;
377  static const QString EXPR_BLUR_RADIUS;
378  static const QString EXPR_DISTANCE;
382  static const QString EXPR_SVG_FILE;
386  static const QString EXPR_LINEWIDTH;
387  static const QString EXPR_DISTANCE_X;
388  static const QString EXPR_DISTANCE_Y;
391  static const QString EXPR_FILE;
392  static const QString EXPR_ALPHA;
393  static const QString EXPR_CUSTOMDASH;
394  static const QString EXPR_LINE_STYLE;
395  static const QString EXPR_JOINSTYLE; //near duplicate is required to maintain project compatibility
396  static const QString EXPR_CAPSTYLE;
397  static const QString EXPR_PLACEMENT;
398  static const QString EXPR_INTERVAL;
402 };
403 
405 
410 class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2
411 {
412  public:
413 
416  {
420  };
421 
424  {
425  Top,
428  };
429 
430  void startRender( QgsSymbolV2RenderContext& context ) override;
431 
437  virtual void renderPoint( QPointF point, QgsSymbolV2RenderContext& context ) = 0;
438 
439  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
440 
446  void setAngle( double angle ) { mAngle = angle; }
447 
451  double angle() const { return mAngle; }
452 
461  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
462 
469  void setSize( double size ) { mSize = size; }
470 
476  double size() const { return mSize; }
477 
484  void setSizeUnit( QgsSymbolV2::OutputUnit unit ) { mSizeUnit = unit; }
485 
491  QgsSymbolV2::OutputUnit sizeUnit() const { return mSizeUnit; }
492 
499  void setSizeMapUnitScale( const QgsMapUnitScale& scale ) { mSizeMapUnitScale = scale; }
500 
506  const QgsMapUnitScale& sizeMapUnitScale() const { return mSizeMapUnitScale; }
507 
512  void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
513 
517  QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; }
518 
526  void setOffset( QPointF offset ) { mOffset = offset; }
527 
534  QPointF offset() const { return mOffset; }
535 
542  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
543 
549  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
550 
557  void setOffsetMapUnitScale( const QgsMapUnitScale& scale ) { mOffsetMapUnitScale = scale; }
558 
564  const QgsMapUnitScale& offsetMapUnitScale() const { return mOffsetMapUnitScale; }
565 
572  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
573 
579  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
580 
587  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
588 
594  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
595 
597  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const override;
598 
604  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const
605  { Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
606 
607  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
608  QgsSymbolV2::OutputUnit outputUnit() const override;
609  void setMapUnitScale( const QgsMapUnitScale& scale ) override;
610  QgsMapUnitScale mapUnitScale() const override;
611 
618  //TODO QGIS 3.0 - make pure virtual
619  virtual QRectF bounds( QPointF point, QgsSymbolV2RenderContext& context ) { Q_UNUSED( context ); Q_UNUSED( point ); return QRectF(); }
620 
621  protected:
622 
626  QgsMarkerSymbolLayerV2( bool locked = false );
627 
634  void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;
635 
645  void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const;
646 
648  void markerOffset( QgsSymbolV2RenderContext& context, double width, double height,
649  QgsSymbolV2::OutputUnit widthUnit, QgsSymbolV2::OutputUnit heightUnit,
650  double& offsetX, double& offsetY,
651  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const;
652 
658  static QPointF _rotatedOffset( QPointF offset, double angle );
659 
661  double mAngle;
663  double mLineAngle;
665  double mSize;
682 
683  private:
684  static QgsMarkerSymbolLayerV2::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString& str );
685  static QgsMarkerSymbolLayerV2::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString& str );
686 };
687 
691 class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2
692 {
693  public:
694  virtual void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context ) = 0;
695 
696  virtual void renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
697 
698  virtual void setWidth( double width ) { mWidth = width; }
699  virtual double width() const { return mWidth; }
700 
701  double offset() const { return mOffset; }
702  void setOffset( double offset ) { mOffset = offset; }
703 
704  void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; }
705  QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; }
706 
707  void setWidthMapUnitScale( const QgsMapUnitScale& scale ) { mWidthMapUnitScale = scale; }
708  const QgsMapUnitScale& widthMapUnitScale() const { return mWidthMapUnitScale; }
709 
710  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
711  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
712 
713  void setOffsetMapUnitScale( const QgsMapUnitScale& scale ) { mOffsetMapUnitScale = scale; }
714  const QgsMapUnitScale& offsetMapUnitScale() const { return mOffsetMapUnitScale; }
715 
716  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
717  QgsSymbolV2::OutputUnit outputUnit() const override;
718 
719  void setMapUnitScale( const QgsMapUnitScale& scale ) override;
720  QgsMapUnitScale mapUnitScale() const override;
721 
722  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
723 
724  virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const override;
725 
726  protected:
727  QgsLineSymbolLayerV2( bool locked = false );
728 
729  double mWidth;
732  double mOffset;
735 };
736 
740 class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2
741 {
742  public:
743  virtual void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context ) = 0;
744 
745  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
746 
747  void setAngle( double angle ) { mAngle = angle; }
748  double angle() const { return mAngle; }
749 
750  protected:
751  QgsFillSymbolLayerV2( bool locked = false );
753  void _renderPolygon( QPainter* p, const QPolygonF& points, const QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
754 
755  double mAngle;
756 };
757 
758 class QgsSymbolLayerV2Widget; // why does SIP fail, when this isn't here
759 
760 #endif
761 
762 
QgsSymbolV2::SymbolType mType
static const QString EXPR_DISTANCE_Y
Class for parsing and evaluation of expressions (formerly called "search strings").
static const QString EXPR_CHAR
static const QString EXPR_OUTLINE_COLOR
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
void setLocked(bool locked)
static const QString EXPR_DISPLACEMENT_Y
static const QString EXPR_JOINSTYLE
QPointF offset() const
Returns the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered mar...
OutputUnit
The unit of the output.
Definition: qgssymbolv2.h:65
virtual void setOutputUnit(QgsSymbolV2::OutputUnit unit)
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
A container class for data source field mapping or expression.
static const QString EXPR_BORDER_COLOR
virtual void setOutlineColor(const QColor &color)
Set outline color.
QDomNode appendChild(const QDomNode &newChild)
static const QString EXPR_USE_WHOLE_SHAPE
static const QString EXPR_REFERENCE2_Y
virtual QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context)
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
QgsSymbolV2::OutputUnit sizeUnit() const
Returns the units for the symbol&#39;s size.
virtual QgsMapUnitScale mapUnitScale() const
double size() const
Returns the symbol size.
static const QString EXPR_DISPLACEMENT_X
virtual QColor outlineColor() const
Get outline color.
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker&#39;s size.
QMap< QString, QgsDataDefined *> mDataDefinedProperties
static const QString EXPR_WIDTH
static const QString EXPR_CUSTOMDASH
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol&#39;s size.
void setOffset(QPointF offset)
Sets the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered marker...
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
Base class for visual effects which can be applied to QPicture drawings.
QgsPaintEffect * mPaintEffect
Container of fields for a vector layer.
Definition: qgsfield.h:252
static const QString EXPR_BLUR_RADIUS
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
static const QString EXPR_COORDINATE_MODE
static const QString EXPR_COLOR2
static const QString EXPR_VERTICAL_ANCHOR_POINT
const QgsMapUnitScale & offsetMapUnitScale() const
static const QString EXPR_OFFSET_ALONG_LINE
QgsMapUnitScale mWidthMapUnitScale
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s offset.
QgsMapUnitScale mOffsetMapUnitScale
static const QString EXPR_OFFSET
QgsSymbolV2::OutputUnit mOffsetUnit
void setWidthUnit(QgsSymbolV2::OutputUnit unit)
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the SLD element following the SLD v1.1 specs.
static const QString EXPR_SIZE
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol&#39;s offset.
virtual void startRender(QgsSymbolV2RenderContext &context)=0
static const QString EXPR_JOIN_STYLE
static const QString EXPR_FILL_STYLE
virtual QgsSymbolV2::OutputUnit outputUnit() const
static const QString EXPR_REFERENCE1_Y
int renderingPass() const
static const QString EXPR_BORDER_STYLE
virtual double width() const
static const QString EXPR_REFERENCE2_X
static const QString EXPR_REFERENCE2_ISCENTROID
virtual double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
Mixed units in symbol layers.
Definition: qgssymbolv2.h:69
static const QString EXPR_LINEWIDTH
static const QString EXPR_PLACEMENT
static const QString EXPR_FILL_COLOR
static const QString EXPR_SPREAD
void setOffset(double offset)
virtual QColor fillColor() const
Get fill color.
static const QString EXPR_LINEANGLE
static const QString EXPR_ALPHA
const QgsMapUnitScale & widthMapUnitScale() const
QgsSymbolV2::OutputUnit mWidthUnit
void setRenderingPass(int renderingPass)
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
virtual void setWidth(double width)
void setAngle(double angle)
QgsSymbolV2::ScaleMethod mScaleMethod
Marker size scaling method.
void setSizeUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol&#39;s size.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
static const QString EXPR_FILL
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
virtual QColor color() const
The fill color.
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units for the symbol&#39;s offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol&#39;s offset.
static const QString EXPR_FILE
double mAngle
Marker rotation angle, in degrees clockwise from north.
static const QString EXPR_CAPSTYLE
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol&#39;s angle.
double mLineAngle
Line rotation angle (see setLineAngle() for details)
static const QString EXPR_OUTLINE_STYLE
virtual void setFillColor(const QColor &color)
Set fill color.
static const QString EXPR_DISTANCE
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
static const QString EXPR_COLOR
static const QString EXPR_WIDTH_BORDER
static const QString EXPR_SVG_FILE
static const QString EXPR_ANGLE
virtual QString layerType() const =0
Returns a string that represents this layer type.
static const QString EXPR_DISTANCE_X
static const QString EXPR_REFERENCE1_X
virtual QgsSymbolV2 * subSymbol()
SymbolType
Type of the symbol.
Definition: qgssymbolv2.h:79
static const QString EXPR_GRADIENT_TYPE
static const QString EXPR_OUTLINE_WIDTH
Contains information about the context of a rendering operation.
VerticalAnchorPoint
Symbol vertical anchor points.
static const QString EXPR_SVG_FILL_COLOR
QgsSymbolV2::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker&#39;s size.
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
ScaleMethod
Scale method.
Definition: qgssymbolv2.h:90
Struct for storing maximum and minimum scales for measurements in map units.
QgsSymbolV2::OutputUnit offsetUnit() const
static const QString EXPR_SVG_OUTLINE_COLOR
static const QString EXPR_NAME
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolV2RenderContext &context) const
get line width
static const QString EXPR_IGNORE_RINGS
static const QString EXPR_COLOR_BORDER
QDomComment createComment(const QString &value)
static const QString EXPR_REFERENCE1_ISCENTROID
static const QString EXPR_ROTATION
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
QgsSymbolV2::OutputUnit mOffsetUnit
Offset units.
virtual void setColor(const QColor &color)
The fill color.
Abstract base class for marker symbol layers.
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point.
QgsSymbolV2::OutputUnit mSizeUnit
Marker size unit.
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
static const QString EXPR_OUTLINE
HorizontalAnchorPoint
Symbol horizontal anchor points.
static const QString EXPR_SVG_OUTLINE_WIDTH
double mSize
Marker size.
virtual void drawPreviewIcon(QgsSymbolV2RenderContext &context, QSize size)=0
static const QString EXPR_SYMBOL_NAME
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setSize(double size)
Sets the symbol size.
void setAngle(double angle)
Sets the rotation angle for the marker.
static const QString EXPR_MAX_DISTANCE
QgsSymbolV2::SymbolType type() const
static const QString EXPR_LINE_STYLE
virtual bool setSubSymbol(QgsSymbolV2 *symbol)
set layer&#39;s subsymbol. takes ownership of the passed symbol
QPointF mOffset
Marker offset.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s size.
static const QString EXPR_INTERVAL
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
QgsSymbolV2::OutputUnit widthUnit() const
static const QString EXPR_HEIGHT
bool isLocked() const
static const QString EXPR_HORIZONTAL_ANCHOR_POINT