QGIS API Documentation  2.15.0-Master (972fc9f)
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 
47 class CORE_EXPORT QgsSymbolLayerV2
48 {
49  public:
50 
51  virtual ~QgsSymbolLayerV2();
52 
56  virtual QColor color() const { return mColor; }
60  virtual void setColor( const QColor& color ) { mColor = color; }
61 
64  virtual void setOutlineColor( const QColor& color ) { Q_UNUSED( color ); }
65 
68  virtual QColor outlineColor() const { return QColor(); }
69 
72  virtual void setFillColor( const QColor& color ) { Q_UNUSED( color ); }
73 
76  virtual QColor fillColor() const { return QColor(); }
77 
82  virtual QString layerType() const = 0;
83 
84  virtual void startRender( QgsSymbolV2RenderContext& context ) = 0;
85  virtual void stopRender( QgsSymbolV2RenderContext& context ) = 0;
86 
90  virtual QgsSymbolLayerV2* clone() const = 0;
91 
92  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const
93  { Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
94 
95  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor ); return QString(); }
96 
102  virtual QgsStringMap properties() const = 0;
103 
104  virtual void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) = 0;
105 
106  virtual QgsSymbolV2* subSymbol() { return nullptr; }
108  virtual bool setSubSymbol( QgsSymbolV2* symbol ) { delete symbol; return false; }
109 
110  QgsSymbolV2::SymbolType type() const { return mType; }
111 
113  virtual bool isCompatibleWithSymbol( QgsSymbolV2* symbol ) const;
114 
115  void setLocked( bool locked ) { mLocked = locked; }
116  bool isLocked() const { return mLocked; }
117 
122  virtual double estimateMaxBleed() const { return 0; }
123 
124  virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); }
126 
127  virtual void setMapUnitScale( const QgsMapUnitScale& scale ) { Q_UNUSED( scale ); }
128  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
129 
130  // used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
131  void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
132  int renderingPass() const { return mRenderingPass; }
133 
137  virtual QSet<QString> usedAttributes() const;
138 
142  Q_DECL_DEPRECATED virtual const QgsExpression* dataDefinedProperty( const QString& property ) const;
143 
147  Q_DECL_DEPRECATED virtual QString dataDefinedPropertyString( const QString& property ) const;
148 
152  Q_DECL_DEPRECATED virtual void setDataDefinedProperty( const QString& property, const QString& expressionString );
153 
162  virtual QgsDataDefined* getDataDefinedProperty( const QString& property ) const;
163 
171  virtual void setDataDefinedProperty( const QString& property, QgsDataDefined* dataDefined );
172 
180  virtual void removeDataDefinedProperty( const QString& property );
181 
187  virtual void removeDataDefinedProperties();
188 
193  virtual bool hasDataDefinedProperties() const;
194 
204  virtual bool hasDataDefinedProperty( const QString& property ) const;
205 
221  Q_DECL_DEPRECATED virtual QVariant evaluateDataDefinedProperty( const QString& property, const QgsFeature* feature, const QVariant& defaultVal = QVariant(), bool *ok = nullptr ) const;
222 
236  virtual QVariant evaluateDataDefinedProperty( const QString& property, const QgsSymbolV2RenderContext& context, const QVariant& defaultVal = QVariant(), bool *ok = nullptr ) const;
237 
239  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
240 
242  virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const;
243 
245  virtual double dxfOffset( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const;
246 
248  virtual QColor dxfColor( QgsSymbolV2RenderContext& context ) const;
249 
251  virtual double dxfAngle( QgsSymbolV2RenderContext& context ) const;
252 
254  virtual QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& unit ) const;
255 
257  virtual Qt::PenStyle dxfPenStyle() const;
258 
260  virtual QColor dxfBrushColor( QgsSymbolV2RenderContext& context ) const;
261 
263  virtual Qt::BrushStyle dxfBrushStyle() const;
264 
270  QgsPaintEffect* paintEffect() const;
271 
277  void setPaintEffect( QgsPaintEffect* effect );
278 
279  protected:
280  QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false );
281 
283  bool mLocked;
286 
290 
291  // Configuration of selected symbology implementation
292  static const bool selectionIsOpaque = true; // Selection ignores symbol alpha
293  static const bool selectFillBorder = false; // Fill symbol layer also selects border symbology
294  static const bool selectFillStyle = false; // Fill symbol uses symbol layer style..
295 
302  Q_DECL_DEPRECATED virtual void prepareExpressions( const QgsFields* fields, double scale = -1.0 );
303 
309  virtual void prepareExpressions( const QgsSymbolV2RenderContext& context );
310 
314  Q_DECL_DEPRECATED virtual QgsExpression* expression( const QString& property ) const;
315 
320  void saveDataDefinedProperties( QgsStringMap& stringMap ) const;
321 
327  void restoreDataDefinedProperties( const QgsStringMap& stringMap );
328 
332  void copyDataDefinedProperties( QgsSymbolLayerV2* destLayer ) const;
333 
338  void copyPaintEffect( QgsSymbolLayerV2* destLayer ) const;
339 
340  static const QString EXPR_SIZE;
341  static const QString EXPR_ANGLE;
342  static const QString EXPR_NAME;
343  static const QString EXPR_COLOR;
347  static const QString EXPR_FILL;
348  static const QString EXPR_OUTLINE;
349  static const QString EXPR_OFFSET;
350  static const QString EXPR_CHAR;
351  static const QString EXPR_FILL_COLOR;
353  static const QString EXPR_WIDTH;
354  static const QString EXPR_HEIGHT;
355  static const QString EXPR_SYMBOL_NAME;
356  static const QString EXPR_ROTATION;
357  static const QString EXPR_FILL_STYLE;
360  static const QString EXPR_JOIN_STYLE;
362  static const QString EXPR_COLOR2;
363  static const QString EXPR_LINEANGLE;
366  static const QString EXPR_SPREAD;
373  static const QString EXPR_BLUR_RADIUS;
374  static const QString EXPR_DISTANCE;
378  static const QString EXPR_SVG_FILE;
382  static const QString EXPR_LINEWIDTH;
383  static const QString EXPR_DISTANCE_X;
384  static const QString EXPR_DISTANCE_Y;
387  static const QString EXPR_FILE;
388  static const QString EXPR_ALPHA;
389  static const QString EXPR_CUSTOMDASH;
390  static const QString EXPR_LINE_STYLE;
391  static const QString EXPR_JOINSTYLE; //near duplicate is required to maintain project compatibility
392  static const QString EXPR_CAPSTYLE;
393  static const QString EXPR_PLACEMENT;
394  static const QString EXPR_INTERVAL;
398 };
399 
401 
406 class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2
407 {
408  public:
409 
412  {
416  };
417 
420  {
421  Top,
424  };
425 
426  void startRender( QgsSymbolV2RenderContext& context ) override;
427 
433  virtual void renderPoint( QPointF point, QgsSymbolV2RenderContext& context ) = 0;
434 
435  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
436 
442  void setAngle( double angle ) { mAngle = angle; }
443 
447  double angle() const { return mAngle; }
448 
457  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
458 
465  void setSize( double size ) { mSize = size; }
466 
472  double size() const { return mSize; }
473 
480  void setSizeUnit( QgsSymbolV2::OutputUnit unit ) { mSizeUnit = unit; }
481 
487  QgsSymbolV2::OutputUnit sizeUnit() const { return mSizeUnit; }
488 
495  void setSizeMapUnitScale( const QgsMapUnitScale& scale ) { mSizeMapUnitScale = scale; }
496 
502  const QgsMapUnitScale& sizeMapUnitScale() const { return mSizeMapUnitScale; }
503 
508  void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
509 
513  QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; }
514 
522  void setOffset( QPointF offset ) { mOffset = offset; }
523 
530  QPointF offset() const { return mOffset; }
531 
538  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
539 
545  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
546 
553  void setOffsetMapUnitScale( const QgsMapUnitScale& scale ) { mOffsetMapUnitScale = scale; }
554 
560  const QgsMapUnitScale& offsetMapUnitScale() const { return mOffsetMapUnitScale; }
561 
568  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
569 
575  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
576 
583  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
584 
590  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
591 
592  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const override;
593 
599  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const
600  { Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
601 
602  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
603  QgsSymbolV2::OutputUnit outputUnit() const override;
604  void setMapUnitScale( const QgsMapUnitScale& scale ) override;
605  QgsMapUnitScale mapUnitScale() const override;
606 
613  //TODO QGIS 3.0 - make pure virtual
614  virtual QRectF bounds( QPointF point, QgsSymbolV2RenderContext& context ) { Q_UNUSED( context ); Q_UNUSED( point ); return QRectF(); }
615 
616  protected:
617 
621  QgsMarkerSymbolLayerV2( bool locked = false );
622 
629  void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;
630 
640  void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const;
641 
643  void markerOffset( QgsSymbolV2RenderContext& context, double width, double height,
644  QgsSymbolV2::OutputUnit widthUnit, QgsSymbolV2::OutputUnit heightUnit,
645  double& offsetX, double& offsetY,
646  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const;
647 
653  static QPointF _rotatedOffset( QPointF offset, double angle );
654 
656  double mAngle;
658  double mLineAngle;
660  double mSize;
677 
678  private:
679  static QgsMarkerSymbolLayerV2::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString& str );
680  static QgsMarkerSymbolLayerV2::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString& str );
681 };
682 
683 class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2
684 {
685  public:
686  virtual void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context ) = 0;
687 
688  virtual void renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
689 
690  virtual void setWidth( double width ) { mWidth = width; }
691  virtual double width() const { return mWidth; }
692 
693  double offset() const { return mOffset; }
694  void setOffset( double offset ) { mOffset = offset; }
695 
696  void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; }
697  QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; }
698 
699  void setWidthMapUnitScale( const QgsMapUnitScale& scale ) { mWidthMapUnitScale = scale; }
700  const QgsMapUnitScale& widthMapUnitScale() const { return mWidthMapUnitScale; }
701 
702  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
703  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
704 
705  void setOffsetMapUnitScale( const QgsMapUnitScale& scale ) { mOffsetMapUnitScale = scale; }
706  const QgsMapUnitScale& offsetMapUnitScale() const { return mOffsetMapUnitScale; }
707 
708  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
709  QgsSymbolV2::OutputUnit outputUnit() const override;
710 
711  void setMapUnitScale( const QgsMapUnitScale& scale ) override;
712  QgsMapUnitScale mapUnitScale() const override;
713 
714  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
715 
716  virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolV2RenderContext& context ) const override;
717 
718  protected:
719  QgsLineSymbolLayerV2( bool locked = false );
720 
721  double mWidth;
724  double mOffset;
727 };
728 
729 class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2
730 {
731  public:
732  virtual void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context ) = 0;
733 
734  void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
735 
736  void setAngle( double angle ) { mAngle = angle; }
737  double angle() const { return mAngle; }
738 
739  protected:
740  QgsFillSymbolLayerV2( bool locked = false );
742  void _renderPolygon( QPainter* p, const QPolygonF& points, const QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
743 
744  double mAngle;
745 };
746 
747 class QgsSymbolLayerV2Widget; // why does SIP fail, when this isn't here
748 
749 #endif
750 
751 
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:62
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:193
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:66
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:76
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:87
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