QGIS API Documentation  2.17.0-Master (6f7b933)
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 
95  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const
96  { Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
97 
98  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor ); return QString(); }
99 
105  virtual QgsStringMap properties() const = 0;
106 
107  virtual void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) = 0;
108 
109  virtual QgsSymbolV2* subSymbol() { return nullptr; }
111  virtual bool setSubSymbol( QgsSymbolV2* symbol ) { delete symbol; return false; }
112 
113  QgsSymbolV2::SymbolType type() const { return mType; }
114 
116  virtual bool isCompatibleWithSymbol( QgsSymbolV2* symbol ) const;
117 
118  void setLocked( bool locked ) { mLocked = locked; }
119  bool isLocked() const { return mLocked; }
120 
125  virtual double estimateMaxBleed() const { return 0; }
126 
127  virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); }
129 
130  virtual void setMapUnitScale( const QgsMapUnitScale& scale ) { Q_UNUSED( scale ); }
131  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
132 
133  // used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
134  void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
135  int renderingPass() const { return mRenderingPass; }
136 
140  virtual QSet<QString> usedAttributes() const;
141 
145  Q_DECL_DEPRECATED virtual const QgsExpression* dataDefinedProperty( const QString& property ) const;
146 
150  Q_DECL_DEPRECATED virtual QString dataDefinedPropertyString( const QString& property ) const;
151 
155  Q_DECL_DEPRECATED virtual void setDataDefinedProperty( const QString& property, const QString& expressionString );
156 
165  virtual QgsDataDefined* getDataDefinedProperty( const QString& property ) const;
166 
174  virtual void setDataDefinedProperty( const QString& property, QgsDataDefined* dataDefined );
175 
183  virtual void removeDataDefinedProperty( const QString& property );
184 
190  virtual void removeDataDefinedProperties();
191 
196  virtual bool hasDataDefinedProperties() const;
197 
207  virtual bool hasDataDefinedProperty( const QString& property ) const;
208 
224  Q_DECL_DEPRECATED virtual QVariant evaluateDataDefinedProperty( const QString& property, const QgsFeature* feature, const QVariant& defaultVal = QVariant(), bool *ok = nullptr ) const;
225 
239  virtual QVariant evaluateDataDefinedProperty( const QString& property, const QgsSymbolV2RenderContext& context, const QVariant& defaultVal = QVariant(), bool *ok = nullptr ) const;
240 
242  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
243 
245  virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const;
246 
248  virtual double dxfOffset( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const;
249 
251  virtual QColor dxfColor( QgsSymbolV2RenderContext& context ) const;
252 
254  virtual double dxfAngle( QgsSymbolV2RenderContext& context ) const;
255 
257  virtual QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& unit ) const;
258 
260  virtual Qt::PenStyle dxfPenStyle() const;
261 
263  virtual QColor dxfBrushColor( QgsSymbolV2RenderContext& context ) const;
264 
266  virtual Qt::BrushStyle dxfBrushStyle() const;
267 
273  QgsPaintEffect* paintEffect() const;
274 
280  void setPaintEffect( QgsPaintEffect* effect );
281 
282  protected:
283  QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false );
284 
286  bool mLocked;
289 
293 
294  // Configuration of selected symbology implementation
295  static const bool selectionIsOpaque = true; // Selection ignores symbol alpha
296  static const bool selectFillBorder = false; // Fill symbol layer also selects border symbology
297  static const bool selectFillStyle = false; // Fill symbol uses symbol layer style..
298 
305  Q_DECL_DEPRECATED virtual void prepareExpressions( const QgsFields* fields, double scale = -1.0 );
306 
312  virtual void prepareExpressions( const QgsSymbolV2RenderContext& context );
313 
317  Q_DECL_DEPRECATED virtual QgsExpression* expression( const QString& property ) const;
318 
323  void saveDataDefinedProperties( QgsStringMap& stringMap ) const;
324 
330  void restoreDataDefinedProperties( const QgsStringMap& stringMap );
331 
335  void copyDataDefinedProperties( QgsSymbolLayerV2* destLayer ) const;
336 
341  void copyPaintEffect( QgsSymbolLayerV2* destLayer ) const;
342 
343  static const QString EXPR_SIZE;
344  static const QString EXPR_ANGLE;
345  static const QString EXPR_NAME;
346  static const QString EXPR_COLOR;
350  static const QString EXPR_FILL;
351  static const QString EXPR_OUTLINE;
352  static const QString EXPR_OFFSET;
353  static const QString EXPR_CHAR;
354  static const QString EXPR_FILL_COLOR;
356  static const QString EXPR_WIDTH;
357  static const QString EXPR_HEIGHT;
358  static const QString EXPR_SYMBOL_NAME;
359  static const QString EXPR_ROTATION;
360  static const QString EXPR_FILL_STYLE;
363  static const QString EXPR_JOIN_STYLE;
365  static const QString EXPR_COLOR2;
366  static const QString EXPR_LINEANGLE;
369  static const QString EXPR_SPREAD;
376  static const QString EXPR_BLUR_RADIUS;
377  static const QString EXPR_DISTANCE;
381  static const QString EXPR_SVG_FILE;
385  static const QString EXPR_LINEWIDTH;
386  static const QString EXPR_DISTANCE_X;
387  static const QString EXPR_DISTANCE_Y;
390  static const QString EXPR_FILE;
391  static const QString EXPR_ALPHA;
392  static const QString EXPR_CUSTOMDASH;
393  static const QString EXPR_LINE_STYLE;
394  static const QString EXPR_JOINSTYLE; //near duplicate is required to maintain project compatibility
395  static const QString EXPR_CAPSTYLE;
396  static const QString EXPR_PLACEMENT;
397  static const QString EXPR_INTERVAL;
401 };
402 
404 
409 class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2
410 {
411  public:
412 
415  {
419  };
420 
423  {
424  Top,
427  };
428 
429  void startRender( QgsSymbolV2RenderContext& context ) override;
430 
436  virtual void renderPoint( QPointF point, QgsSymbolV2RenderContext& context ) = 0;
437 
438  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
439 
445  void setAngle( double angle ) { mAngle = angle; }
446 
450  double angle() const { return mAngle; }
451 
460  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
461 
468  void setSize( double size ) { mSize = size; }
469 
475  double size() const { return mSize; }
476 
483  void setSizeUnit( QgsSymbolV2::OutputUnit unit ) { mSizeUnit = unit; }
484 
490  QgsSymbolV2::OutputUnit sizeUnit() const { return mSizeUnit; }
491 
498  void setSizeMapUnitScale( const QgsMapUnitScale& scale ) { mSizeMapUnitScale = scale; }
499 
505  const QgsMapUnitScale& sizeMapUnitScale() const { return mSizeMapUnitScale; }
506 
511  void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
512 
516  QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; }
517 
525  void setOffset( QPointF offset ) { mOffset = offset; }
526 
533  QPointF offset() const { return mOffset; }
534 
541  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
542 
548  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
549 
556  void setOffsetMapUnitScale( const QgsMapUnitScale& scale ) { mOffsetMapUnitScale = scale; }
557 
563  const QgsMapUnitScale& offsetMapUnitScale() const { return mOffsetMapUnitScale; }
564 
571  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
572 
578  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
579 
586  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
587 
593  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
594 
595  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const override;
596 
602  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const
603  { Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
604 
605  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
606  QgsSymbolV2::OutputUnit outputUnit() const override;
607  void setMapUnitScale( const QgsMapUnitScale& scale ) override;
608  QgsMapUnitScale mapUnitScale() const override;
609 
616  //TODO QGIS 3.0 - make pure virtual
617  virtual QRectF bounds( QPointF point, QgsSymbolV2RenderContext& context ) { Q_UNUSED( context ); Q_UNUSED( point ); return QRectF(); }
618 
619  protected:
620 
624  QgsMarkerSymbolLayerV2( bool locked = false );
625 
632  void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;
633 
643  void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const;
644 
646  void markerOffset( QgsSymbolV2RenderContext& context, double width, double height,
647  QgsSymbolV2::OutputUnit widthUnit, QgsSymbolV2::OutputUnit heightUnit,
648  double& offsetX, double& offsetY,
649  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const;
650 
656  static QPointF _rotatedOffset( QPointF offset, double angle );
657 
659  double mAngle;
661  double mLineAngle;
663  double mSize;
680 
681  private:
682  static QgsMarkerSymbolLayerV2::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString& str );
683  static QgsMarkerSymbolLayerV2::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString& str );
684 };
685 
689 class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2
690 {
691  public:
692  virtual void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context ) = 0;
693 
694  virtual void renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
695 
696  virtual void setWidth( double width ) { mWidth = width; }
697  virtual double width() const { return mWidth; }
698 
699  double offset() const { return mOffset; }
700  void setOffset( double offset ) { mOffset = offset; }
701 
702  void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; }
703  QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; }
704 
705  void setWidthMapUnitScale( const QgsMapUnitScale& scale ) { mWidthMapUnitScale = scale; }
706  const QgsMapUnitScale& widthMapUnitScale() const { return mWidthMapUnitScale; }
707 
708  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
709  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
710 
711  void setOffsetMapUnitScale( const QgsMapUnitScale& scale ) { mOffsetMapUnitScale = scale; }
712  const QgsMapUnitScale& offsetMapUnitScale() const { return mOffsetMapUnitScale; }
713 
714  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
715  QgsSymbolV2::OutputUnit outputUnit() const override;
716 
717  void setMapUnitScale( const QgsMapUnitScale& scale ) override;
718  QgsMapUnitScale mapUnitScale() const override;
719 
720  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
721 
722  virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const override;
723 
724  protected:
725  QgsLineSymbolLayerV2( bool locked = false );
726 
727  double mWidth;
730  double mOffset;
733 };
734 
738 class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2
739 {
740  public:
741  virtual void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context ) = 0;
742 
743  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
744 
745  void setAngle( double angle ) { mAngle = angle; }
746  double angle() const { return mAngle; }
747 
748  protected:
749  QgsFillSymbolLayerV2( bool locked = false );
751  void _renderPolygon( QPainter* p, const QPolygonF& points, const QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
752 
753  double mAngle;
754 };
755 
756 class QgsSymbolLayerV2Widget; // why does SIP fail, when this isn't here
757 
758 #endif
759 
760 
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
QgsSymbolV2::SymbolType mType
static const QString EXPR_DISTANCE_Y
Class for parsing and evaluation of expressions (formerly called "search strings").
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
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
virtual QgsSymbolV2::OutputUnit outputUnit() const
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 double width() const
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
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...
static const QString EXPR_DISPLACEMENT_X
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
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
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:209
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
QgsSymbolV2::OutputUnit sizeUnit() const
Returns the units for the symbol&#39;s size.
static const QString EXPR_VERTICAL_ANCHOR_POINT
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
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolV2RenderContext &context) const
get line width
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s offset.
QgsMapUnitScale mOffsetMapUnitScale
virtual QColor fillColor() const
Get fill color.
static const QString EXPR_OFFSET
QgsSymbolV2::OutputUnit mOffsetUnit
void setWidthUnit(QgsSymbolV2::OutputUnit unit)
static const QString EXPR_SIZE
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol&#39;s offset.
virtual double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
virtual void startRender(QgsSymbolV2RenderContext &context)=0
static const QString EXPR_JOIN_STYLE
static const QString EXPR_FILL_STYLE
static const QString EXPR_REFERENCE1_Y
static const QString EXPR_BORDER_STYLE
static const QString EXPR_REFERENCE2_X
static const QString EXPR_REFERENCE2_ISCENTROID
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units for the symbol&#39;s offset.
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)
static const QString EXPR_LINEANGLE
static const QString EXPR_ALPHA
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.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol&#39;s size.
static const QString EXPR_FILL
virtual QColor color() const
The fill color.
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
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)
QgsSymbolV2::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker&#39;s size.
static const QString EXPR_OUTLINE_STYLE
double size() const
Returns the symbol size.
QgsSymbolV2::SymbolType type() const
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
int renderingPass() const
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
virtual QColor outlineColor() const
Get outline color.
Contains information about the context of a rendering operation.
VerticalAnchorPoint
Symbol vertical anchor points.
static const QString EXPR_SVG_FILL_COLOR
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol&#39;s offset.
QgsSymbolV2::OutputUnit offsetUnit() const
ScaleMethod
Scale method.
Definition: qgssymbolv2.h:90
Struct for storing maximum and minimum scales for measurements in map units.
bool isLocked() const
const QgsMapUnitScale & offsetMapUnitScale() const
const QgsMapUnitScale & widthMapUnitScale() const
static const QString EXPR_SVG_OUTLINE_COLOR
static const QString EXPR_NAME
double offset() const
static const QString EXPR_IGNORE_RINGS
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
static const QString EXPR_COLOR_BORDER
virtual QgsMapUnitScale mapUnitScale() const
QDomComment createComment(const QString &value)
static const QString EXPR_REFERENCE1_ISCENTROID
static const QString EXPR_ROTATION
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.
QPointF offset() const
Returns the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered mar...
static const QString EXPR_MAX_DISTANCE
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.
double angle() const
static const QString EXPR_INTERVAL
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
QgsSymbolV2::OutputUnit widthUnit() const
static const QString EXPR_HEIGHT
static const QString EXPR_HORIZONTAL_ANCHOR_POINT