QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsfillsymbollayerv2.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfillsymbollayerv2.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 
16 #ifndef QGSFILLSYMBOLLAYERV2_H
17 #define QGSFILLSYMBOLLAYERV2_H
18 
19 #include "qgssymbollayerv2.h"
20 
21 #define DEFAULT_SIMPLEFILL_COLOR QColor(0,0,255)
22 #define DEFAULT_SIMPLEFILL_STYLE Qt::SolidPattern
23 #define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor(0,0,0)
24 #define DEFAULT_SIMPLEFILL_BORDERSTYLE Qt::SolidLine
25 #define DEFAULT_SIMPLEFILL_BORDERWIDTH DEFAULT_LINE_WIDTH
26 #define DEFAULT_SIMPLEFILL_JOINSTYLE Qt::BevelJoin
27 
28 #define INF 1E20
29 
30 #include <QPen>
31 #include <QBrush>
32 
34 {
35  public:
37  Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
38  QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
39  Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
40  double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH,
41  Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEFILL_JOINSTYLE
42  );
43 
44  // static stuff
45 
46  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
47  static QgsSymbolLayerV2* createFromSld( QDomElement &element );
48 
49  // implemented from base classes
50 
51  QString layerType() const;
52 
53  void startRender( QgsSymbolV2RenderContext& context );
54 
55  void stopRender( QgsSymbolV2RenderContext& context );
56 
57  void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
58 
59  QgsStringMap properties() const;
60 
61  QgsSymbolLayerV2* clone() const;
62 
63  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
64 
65  QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
66 
67  Qt::BrushStyle brushStyle() const { return mBrushStyle; }
68  void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; }
69 
70  QColor borderColor() const { return mBorderColor; }
71  void setBorderColor( QColor borderColor ) { mBorderColor = borderColor; }
72 
75  QColor outlineColor() const { return borderColor(); }
78  void setOutlineColor( const QColor& color ) { setBorderColor( color ); }
79 
82  QColor fillColor() const { return color(); }
85  void setFillColor( const QColor& color ) { setColor( color ); }
86 
87  Qt::PenStyle borderStyle() const { return mBorderStyle; }
88  void setBorderStyle( Qt::PenStyle borderStyle ) { mBorderStyle = borderStyle; }
89 
90  double borderWidth() const { return mBorderWidth; }
91  void setBorderWidth( double borderWidth ) { mBorderWidth = borderWidth; }
92 
93  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
94  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
95 
96  void setOffset( QPointF offset ) { mOffset = offset; }
97  QPointF offset() { return mOffset; }
98 
99  void setBorderWidthUnit( QgsSymbolV2::OutputUnit unit ) { mBorderWidthUnit = unit; }
100  QgsSymbolV2::OutputUnit borderWidthUnit() const { return mBorderWidthUnit; }
101 
102  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
103  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
104 
107 
108  double estimateMaxBleed() const;
109 
110  double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& context ) const;
111  QColor dxfColor( const QgsSymbolV2RenderContext& context ) const;
112  Qt::PenStyle dxfPenStyle() const;
113 
114  protected:
115  QBrush mBrush;
116  QBrush mSelBrush;
117  Qt::BrushStyle mBrushStyle;
118  QColor mBorderColor;
119  Qt::PenStyle mBorderStyle;
120  double mBorderWidth;
122  Qt::PenJoinStyle mPenJoinStyle;
123  QPen mPen;
124  QPen mSelPen;
125 
126  QPointF mOffset;
128 
129  private:
130  //helper functions for data defined symbology
131  void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, QBrush& brush, QPen& pen, QPen& selPen );
132 };
133 
135 
137 {
138  public:
139 
141  {
143  ColorRamp
144  };
145 
147  {
150  Conical
151  };
152 
154  {
156  Viewport
157  };
158 
160  {
163  Repeat
164  };
165 
167  QColor color2 = Qt::white,
168  GradientColorType gradientColorType = SimpleTwoColor,
169  GradientType gradientType = Linear,
170  GradientCoordinateMode coordinateMode = Feature,
171  GradientSpread gradientSpread = Pad
172  );
173 
174  virtual ~QgsGradientFillSymbolLayerV2();
175 
176  // static stuff
177 
178  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
179 
180  // implemented from base classes
181 
182  QString layerType() const;
183 
184  void startRender( QgsSymbolV2RenderContext& context );
185 
186  void stopRender( QgsSymbolV2RenderContext& context );
187 
188  void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
189 
190  QgsStringMap properties() const;
191 
192  QgsSymbolLayerV2* clone() const;
193 
194  double estimateMaxBleed() const;
195 
197  GradientType gradientType() const { return mGradientType; };
198  void setGradientType( GradientType gradientType ) { mGradientType = gradientType; };
199 
201  GradientColorType gradientColorType() const { return mGradientColorType; };
202  void setGradientColorType( GradientColorType gradientColorType ) { mGradientColorType = gradientColorType; };
203 
205  QgsVectorColorRampV2* colorRamp() { return mGradientRamp; };
206  void setColorRamp( QgsVectorColorRampV2* ramp );
207 
209  QColor color2() const { return mColor2; };
210  void setColor2( QColor color2 ) { mColor2 = color2; };
211 
213  GradientCoordinateMode coordinateMode() const { return mCoordinateMode; };
214  void setCoordinateMode( GradientCoordinateMode coordinateMode ) { mCoordinateMode = coordinateMode; };
215 
217  GradientSpread gradientSpread() const { return mGradientSpread; };
218  void setGradientSpread( GradientSpread gradientSpread ) { mGradientSpread = gradientSpread; };
219 
221  void setReferencePoint1( QPointF referencePoint ) { mReferencePoint1 = referencePoint; };
222  QPointF referencePoint1() const { return mReferencePoint1; };
223 
225  void setReferencePoint1IsCentroid( bool isCentroid ) { mReferencePoint1IsCentroid = isCentroid; };
226  bool referencePoint1IsCentroid() const { return mReferencePoint1IsCentroid; };
227 
229  void setReferencePoint2( QPointF referencePoint ) { mReferencePoint2 = referencePoint; };
230  QPointF referencePoint2() const { return mReferencePoint2; };
231 
233  void setReferencePoint2IsCentroid( bool isCentroid ) { mReferencePoint2IsCentroid = isCentroid; };
234  bool referencePoint2IsCentroid() const { return mReferencePoint2IsCentroid; };
235 
237  void setAngle( double angle ) { mAngle = angle; };
238  double angle() const { return mAngle; };
239 
241  void setOffset( QPointF offset ) { mOffset = offset; };
242  QPointF offset() const { return mOffset; };
243 
245  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; };
246  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; };
247 
248  protected:
249  QBrush mBrush;
250  QBrush mSelBrush;
251 
253  QColor mColor2;
258 
263  double mAngle;
264 
265  QPointF mOffset;
267 
268  private:
269 
270  //helper functions for data defined symbology
271  void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, const QPolygonF& points );
272 
274  void applyGradient( const QgsSymbolV2RenderContext& context, QBrush& brush, const QColor& color, const QColor& color2,
275  const GradientColorType &gradientColorType, QgsVectorColorRampV2 *gradientRamp, const GradientType &gradientType,
276  const GradientCoordinateMode &coordinateMode, const GradientSpread &gradientSpread,
277  const QPointF &referencePoint1, const QPointF &referencePoint2, const double angle );
278 
280  QPointF rotateReferencePoint( const QPointF & refPoint, double angle );
281 };
282 
284 {
285  public:
286 
288  {
290  ColorRamp
291  };
292 
293  QgsShapeburstFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR, QColor color2 = Qt::white,
294  ShapeburstColorType colorType = SimpleTwoColor,
295  int blurRadius = 0, bool useWholeShape = true, double maxDistance = 5 );
296 
298 
299  // static stuff
300 
301  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
302 
303  // implemented from base classes
304 
305  QString layerType() const;
306 
307  void startRender( QgsSymbolV2RenderContext& context );
308 
309  void stopRender( QgsSymbolV2RenderContext& context );
310 
311  void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
312 
313  QgsStringMap properties() const;
314 
315  QgsSymbolLayerV2* clone() const;
316 
317  double estimateMaxBleed() const;
318 
324  void setBlurRadius( int blurRadius ) { mBlurRadius = blurRadius; };
330  int blurRadius() const { return mBlurRadius; };
331 
339  void setUseWholeShape( double useWholeShape ) { mUseWholeShape = useWholeShape; };
346  double useWholeShape() const { return mUseWholeShape; };
347 
355  void setMaxDistance( double maxDistance ) { mMaxDistance = maxDistance; };
363  double maxDistance() const { return mMaxDistance; };
364 
371  void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; }
378  QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; }
379 
389  void setColorType( ShapeburstColorType colorType ) { mColorType = colorType; };
399  ShapeburstColorType colorType() const { return mColorType; };
400 
407  void setColorRamp( QgsVectorColorRampV2* ramp );
414  QgsVectorColorRampV2* colorRamp() { return mGradientRamp; };
415 
422  void setColor2( QColor color2 ) { mColor2 = color2; };
429  QColor color2() const { return mColor2; };
430 
437  void setIgnoreRings( double ignoreRings ) { mIgnoreRings = ignoreRings; };
443  double ignoreRings() const { return mIgnoreRings; };
444 
451  void setOffset( QPointF offset ) { mOffset = offset; };
458  QPointF offset() const { return mOffset; };
459 
466  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; };
473  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; };
474 
475  protected:
476  QBrush mBrush;
477  QBrush mSelBrush;
478 
480 
482  double mMaxDistance;
484 
486  QColor mColor2;
489 
491 
492  QPointF mOffset;
494 
495  private:
496 
497  //helper functions for data defined symbology
498  void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, QColor& color, QColor& color2, int& blurRadius, bool& useWholeShape,
499  double& maxDistance , bool &ignoreRings );
500 
501  /* distance transform of a 1d function using squared distance */
502  void distanceTransform1d( double *f, int n, int *v, double *z, double *d );
503  /* distance transform of 2d function using squared distance */
504  void distanceTransform2d( double * im, int width, int height );
505  /* distance transform of a binary QImage */
506  double * distanceTransform( QImage * im );
507 
508  /* fills a QImage with values from an array of doubles containing squared distance transform values */
509  void dtArrayToQImage( double * array, QImage *im, QgsVectorColorRampV2* ramp, double layerAlpha = 1, bool useWholeShape = true, int maxPixelDistance = 0 );
510 };
511 
514 {
515  public:
517  virtual ~QgsImageFillSymbolLayer();
518  void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
519 
520  virtual QgsSymbolV2* subSymbol() { return mOutline; }
521  virtual bool setSubSymbol( QgsSymbolV2* symbol );
522 
523  void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidthUnit = unit; }
524  QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidthUnit; }
525 
526  virtual double estimateMaxBleed() const;
527 
528  virtual double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& context ) const;
529  virtual QColor dxfColor( const QgsSymbolV2RenderContext& context ) const;
530  virtual Qt::PenStyle dxfPenStyle() const;
531 
532  protected:
533  QBrush mBrush;
534  double mNextAngle; // mAngle / data defined angle
535 
539 
542 
543  virtual void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context ) { Q_UNUSED( context ); }
544 };
545 
549 {
550  public:
551  QgsSVGFillSymbolLayer( const QString& svgFilePath = "", double width = 20, double rotation = 0.0 );
552  QgsSVGFillSymbolLayer( const QByteArray& svgData, double width = 20, double rotation = 0.0 );
554 
555  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
556  static QgsSymbolLayerV2* createFromSld( QDomElement &element );
557 
558  // implemented from base classes
559 
560  QString layerType() const;
561 
562  void startRender( QgsSymbolV2RenderContext& context );
563  void stopRender( QgsSymbolV2RenderContext& context );
564 
565  QgsStringMap properties() const;
566 
567  QgsSymbolLayerV2* clone() const;
568 
569  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
570 
571  //getters and setters
572  void setSvgFilePath( const QString& svgPath );
573  QString svgFilePath() const { return mSvgFilePath; }
574  void setPatternWidth( double width ) { mPatternWidth = width;}
575  double patternWidth() const { return mPatternWidth; }
576 
577  void setSvgFillColor( const QColor& c ) { mSvgFillColor = c; }
578  QColor svgFillColor() const { return mSvgFillColor; }
579  void setSvgOutlineColor( const QColor& c ) { mSvgOutlineColor = c; }
580  QColor svgOutlineColor() const { return mSvgOutlineColor; }
581  void setSvgOutlineWidth( double w ) { mSvgOutlineWidth = w; }
582  double svgOutlineWidth() const { return mSvgOutlineWidth; }
583 
584  void setPatternWidthUnit( QgsSymbolV2::OutputUnit unit ) { mPatternWidthUnit = unit; }
585  QgsSymbolV2::OutputUnit patternWidthUnit() const { return mPatternWidthUnit; }
586 
587  void setSvgOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mSvgOutlineWidthUnit = unit; }
588  QgsSymbolV2::OutputUnit svgOutlineWidthUnit() const { return mSvgOutlineWidthUnit; }
589 
592 
593  protected:
597 
599  QByteArray mSvgData;
601  QString mSvgFilePath;
603  QRectF mSvgViewBox;
606  QImage* mSvgPattern;
607 
608  //param(fill), param(outline), param(outline-width) are going
609  //to be replaced in memory
614 
615  void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
616 
617  private:
619  void storeViewBox();
620  void setDefaultSvgParams(); //fills mSvgFillColor, mSvgOutlineColor, mSvgOutlineWidth with default values for mSvgFilePath
621 
623  void applyPattern( QBrush& brush, const QString& svgFilePath, double patternWidth, QgsSymbolV2::OutputUnit patternWidthUnit, const QColor& svgFillColor, const QColor& svgOutlineColor,
624  double svgOutlineWidth, QgsSymbolV2::OutputUnit svgOutlineWidthUnit, const QgsSymbolV2RenderContext& context );
625 };
626 
628 {
629  public:
632 
633  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
634  static QgsSymbolLayerV2* createFromSld( QDomElement &element );
635 
636  QString layerType() const;
637 
638  void startRender( QgsSymbolV2RenderContext& context );
639 
640  void stopRender( QgsSymbolV2RenderContext& context );
641 
642  QgsStringMap properties() const;
643 
644  QgsSymbolLayerV2* clone() const;
645 
646  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
647 
648  double estimateMaxBleed() const;
649 
650  QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
651 
652  //getters and setters
653  void setLineAngle( double a ) { mLineAngle = a; }
654  double lineAngle() const { return mLineAngle; }
655  void setDistance( double d ) { mDistance = d; }
656  double distance() const { return mDistance; }
657  void setLineWidth( double w );
658  double lineWidth() const { return mLineWidth; }
659  void setColor( const QColor& c );
660  QColor color() const { return mColor; }
661  void setOffset( double offset ) { mOffset = offset; }
662  double offset() const { return mOffset; }
663 
664  void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; }
665  QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; }
666 
667  void setLineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mLineWidthUnit = unit; }
668  QgsSymbolV2::OutputUnit lineWidthUnit() const { return mLineWidthUnit; }
669 
670  void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
671  QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
672 
675 
676  bool setSubSymbol( QgsSymbolV2* symbol );
678 
679  protected:
681  double mDistance;
684  double mLineWidth;
686  QColor mColor;
688  double mLineAngle;
690  double mOffset;
692 
693  void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
694 
695  private:
697  void applyPattern( const QgsSymbolV2RenderContext& context, QBrush& brush, double lineAngle, double distance, double lineWidth, const QColor& color );
698 
701 };
702 
704 {
705  public:
708 
709  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
710  static QgsSymbolLayerV2* createFromSld( QDomElement &element );
711 
712  QString layerType() const;
713 
714  void startRender( QgsSymbolV2RenderContext& context );
715 
716  void stopRender( QgsSymbolV2RenderContext& context );
717 
718  QgsStringMap properties() const;
719 
720  QgsSymbolLayerV2* clone() const;
721 
722  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
723 
724  double estimateMaxBleed() const;
725 
726  //getters and setters
727  double distanceX() const { return mDistanceX; }
728  void setDistanceX( double d ) { mDistanceX = d; }
729 
730  double distanceY() const { return mDistanceY; }
731  void setDistanceY( double d ) { mDistanceY = d; }
732 
733  double displacementX() const { return mDisplacementX; }
734  void setDisplacementX( double d ) { mDisplacementX = d; }
735 
736  double displacementY() const { return mDisplacementY; }
737  void setDisplacementY( double d ) { mDisplacementY = d; }
738 
739  bool setSubSymbol( QgsSymbolV2* symbol );
740  virtual QgsSymbolV2* subSymbol() { return mMarkerSymbol; }
741 
742  void setDistanceXUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceXUnit = unit; }
743  QgsSymbolV2::OutputUnit distanceXUnit() const { return mDistanceXUnit; }
744 
745  void setDistanceYUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceYUnit = unit; }
746  QgsSymbolV2::OutputUnit distanceYUnit() const { return mDistanceYUnit; }
747 
748  void setDisplacementXUnit( QgsSymbolV2::OutputUnit unit ) { mDisplacementXUnit = unit; }
749  QgsSymbolV2::OutputUnit displacementXUnit() const { return mDisplacementXUnit; }
750 
751  void setDisplacementYUnit( QgsSymbolV2::OutputUnit unit ) { mDisplacementYUnit = unit; }
752  QgsSymbolV2::OutputUnit displacementYUnit() const { return mDisplacementYUnit; }
753 
756 
757  virtual QSet<QString> usedAttributes() const;
758 
759  protected:
761  double mDistanceX;
763  double mDistanceY;
769 
770  void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
771 
772  private:
773  void applyPattern( const QgsSymbolV2RenderContext& context, QBrush& brush, double distanceX, double distanceY,
774  double displacementX, double displacementY );
775 };
776 
778 {
779  public:
782 
783  // static stuff
784 
785  static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
786  static QgsSymbolLayerV2* createFromSld( QDomElement &element );
787 
788  // implemented from base classes
789 
790  QString layerType() const;
791 
792  void startRender( QgsSymbolV2RenderContext& context );
793 
794  void stopRender( QgsSymbolV2RenderContext& context );
795 
796  void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
797 
798  QgsStringMap properties() const;
799 
800  QgsSymbolLayerV2* clone() const;
801 
802  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
803 
804  void setColor( const QColor& color );
805 
807  bool setSubSymbol( QgsSymbolV2* symbol );
808 
809  void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); }
811 
812  virtual QSet<QString> usedAttributes() const;
813 
814  protected:
816 };
817 
818 #endif
virtual QSet< QString > usedAttributes() const
QgsVectorColorRampV2 * colorRamp()
Color ramp used for the gradient fill, only used if the gradient color type is set to ColorRamp...
QgsSymbolV2::OutputUnit patternWidthUnit() const
void setDistanceUnit(QgsSymbolV2::OutputUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
#define DEFAULT_SIMPLEFILL_BORDERCOLOR
QgsVectorColorRampV2 * colorRamp()
Returns the color ramp used for the shapeburst fill.
QgsSymbolV2::OutputUnit distanceYUnit() const
void setReferencePoint1(QPointF referencePoint)
Starting point of gradient fill, in the range [0,0] - [1,1].
QgsSymbolV2::OutputUnit mSvgOutlineWidthUnit
void setReferencePoint2IsCentroid(bool isCentroid)
Sets the end point of the gradient to be the feature centroid.
void setSvgOutlineWidth(double w)
virtual QgsSymbolV2::OutputUnit outputUnit() const
void setAngle(double angle)
Rotation angle for gradient fill.
virtual void setOutputUnit(QgsSymbolV2::OutputUnit unit)
virtual Qt::PenStyle dxfPenStyle() const
double ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
virtual QgsSymbolLayerV2 * clone() const =0
virtual double dxfWidth(const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const
QgsSymbolV2::OutputUnit mLineWidthUnit
void setCoordinateMode(GradientCoordinateMode coordinateMode)
QgsSymbolV2::OutputUnit distanceXUnit() const
void setSvgFillColor(const QColor &c)
QgsSymbolV2::OutputUnit offsetUnit() const
void setDistanceYUnit(QgsSymbolV2::OutputUnit unit)
virtual QgsSymbolV2 * subSymbol()
QString svgFilePath() const
virtual void applyDataDefinedSettings(const QgsSymbolV2RenderContext &context)
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
double svgOutlineWidth() const
Base class for polygon renderers generating texture images.
GradientCoordinateMode mCoordinateMode
QgsSymbolV2::OutputUnit svgOutlineWidthUnit() const
void setColor2(QColor color2)
Sets the color for the endpoint of the shapeburst fill.
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient.
virtual void renderPolygon(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)=0
QgsSymbolV2::OutputUnit mDisplacementXUnit
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
double useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
double mDistance
Distance (in mm or map units) between lines.
void setBorderColor(QColor borderColor)
QColor fillColor() const
Get fill color.
void setSvgOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
double mLineAngle
Vector line angle in degrees (0 = horizontal, counterclockwise)
QgsVectorColorRampV2 * mGradientRamp
QMap< QString, QString > QgsStringMap
Definition: qgis.h:416
void setFillColor(const QColor &color)
Set fill color.
void setPatternWidth(double width)
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
virtual double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
void setSvgOutlineColor(const QColor &c)
virtual void startRender(QgsSymbolV2RenderContext &context)=0
virtual QgsSymbolV2 * subSymbol()
void setDistanceUnit(QgsSymbolV2::OutputUnit unit)
void setGradientType(GradientType gradientType)
QgsSymbolV2::OutputUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
QgsSymbolV2::OutputUnit mDisplacementYUnit
virtual void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
#define DEFAULT_SIMPLEFILL_BORDERSTYLE
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
QByteArray mSvgData
SVG data.
Qt::PenStyle borderStyle() const
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
QgsLineSymbolV2 * mOutline
Custom outline.
#define DEFAULT_SIMPLEFILL_STYLE
double mOffset
Offset perpendicular to line direction.
void setPenJoinStyle(Qt::PenJoinStyle style)
void setBrushStyle(Qt::BrushStyle style)
void setReferencePoint1IsCentroid(bool isCentroid)
Sets the starting point of the gradient to be the feature centroid.
QgsVectorColorRampV2 * mTwoColorGradientRamp
void setLineWidthUnit(QgsSymbolV2::OutputUnit unit)
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
QPointF offset() const
Returns the offset for the shapeburst fill.
QgsSymbolV2::OutputUnit mOffsetUnit
QgsSymbolV2::OutputUnit distanceUnit() const
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
virtual QgsStringMap properties() const =0
QgsSymbolV2::OutputUnit borderWidthUnit() const
virtual QColor color() const
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
void setDisplacementXUnit(QgsSymbolV2::OutputUnit unit)
QgsSymbolV2::OutputUnit mOffsetUnit
void setBorderWidthUnit(QgsSymbolV2::OutputUnit unit)
QgsSymbolV2::OutputUnit mOffsetUnit
QString mSvgFilePath
Path to the svg file (or empty if constructed directly from data)
QgsSymbolV2::OutputUnit mOffsetUnit
virtual QColor dxfColor(const QgsSymbolV2RenderContext &context) const
QgsSymbolV2::OutputUnit mOutlineWidthUnit
double mOutlineWidth
Outline width.
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 setColorType(ShapeburstColorType colorType)
Sets the color mode to use for the shapeburst fill.
void setDistanceXUnit(QgsSymbolV2::OutputUnit unit)
double mLineWidth
Line width (in mm or map units)
QgsVectorColorRampV2 * mGradientRamp
QColor svgOutlineColor() const
GradientSpread gradientSpread() const
Gradient spread mode.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
virtual bool setSubSymbol(QgsSymbolV2 *symbol)
void setOffset(QPointF offset)
Offset for gradient fill.
virtual QString layerType() const =0
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units used for the offset for the shapeburst fill.
QgsSymbolV2::OutputUnit mDistanceYUnit
virtual QgsSymbolV2 * subSymbol()
void setOffset(QPointF offset)
QgsSymbolV2::OutputUnit lineWidthUnit() const
A class for svg fill patterns.
double widthScaleFactor
Definition: qgssvgcache.cpp:79
void setGradientColorType(GradientColorType gradientColorType)
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
QgsSymbolV2::OutputUnit mDistanceXUnit
void setDisplacementYUnit(QgsSymbolV2::OutputUnit unit)
QgsSymbolV2::OutputUnit displacementYUnit() const
QgsSymbolV2::OutputUnit mBorderWidthUnit
Qt::PenJoinStyle penJoinStyle() const
QgsSymbolV2::OutputUnit mDistanceUnit
void setOutputUnit(QgsSymbolV2::OutputUnit unit)
void setOutlineColor(const QColor &color)
Set outline color.
virtual void setColor(const QColor &color)
GradientType gradientType() const
Type of gradient, eg linear or radial.
QgsSymbolV2::OutputUnit outlineWidthUnit() const
void setUseWholeShape(double useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
QgsSymbolV2::OutputUnit mDistanceUnit
QColor outlineColor() const
Get outline color.
QgsLineSymbolV2 * mFillLineSymbol
Fill line.
virtual double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
void setPatternWidthUnit(QgsSymbolV2::OutputUnit unit)
QgsSymbolV2::OutputUnit displacementXUnit() const
void setGradientSpread(GradientSpread gradientSpread)
QgsSymbolV2::OutputUnit mPatternWidthUnit
QgsSymbolV2::OutputUnit offsetUnit() const
void setReferencePoint2(QPointF referencePoint)
End point of gradient fill, in the range [0,0] - [1,1].
void setBorderWidth(double borderWidth)
#define DEFAULT_SIMPLEFILL_JOINSTYLE
virtual bool setSubSymbol(QgsSymbolV2 *symbol)
virtual void stopRender(QgsSymbolV2RenderContext &context)=0
double angle() const
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
Qt::BrushStyle brushStyle() const
#define DEFAULT_SIMPLEFILL_BORDERWIDTH
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Units for gradient fill offset.
QgsSymbolV2::OutputUnit offsetUnit() const
QRectF mSvgViewBox
SVG view box (to keep the aspect ratio.
void setIgnoreRings(double ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading...
QImage * mSvgPattern
SVG pattern image.
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
double mPatternWidth
Width of the pattern (in output units)
#define DEFAULT_SIMPLEFILL_COLOR
void setBorderStyle(Qt::PenStyle borderStyle)