2016-08-06 11:01:42 +02:00
class QgsSimpleFillSymbolLayer : QgsFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
2016-08-06 11:01:42 +02:00
QgsSimpleFillSymbolLayer( const QColor& color = DEFAULT_SIMPLEFILL_COLOR,
2012-09-24 02:28:15 +02:00
Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
2015-10-07 18:32:24 +11:00
const QColor& borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
2012-09-24 02:28:15 +02:00
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
2014-03-17 18:42:41 +11:00
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH,
Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEFILL_JOINSTYLE
);
2014-05-07 19:02:11 +02:00
2012-09-24 02:28:15 +02:00
// static stuff
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer* createFromSld( QDomElement &element ) /Factory/;
2012-09-24 02:28:15 +02:00
// implemented from base classes
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
QgsStringMap properties() const;
2016-08-06 11:01:42 +02:00
virtual QgsSimpleFillSymbolLayer* clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2015-10-07 11:55:34 +11:00
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const;
2012-09-24 02:28:15 +02:00
2013-06-23 16:00:16 +02:00
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
2012-09-24 02:28:15 +02:00
Qt::BrushStyle brushStyle() const;
void setBrushStyle( Qt::BrushStyle style );
QColor borderColor() const;
2015-10-07 18:32:24 +11:00
void setBorderColor( const QColor& borderColor );
2012-09-24 02:28:15 +02:00
2014-01-26 18:35:21 +01:00
/** Get outline color.
* @note added in 2.1 */
2014-01-27 09:22:24 +01:00
QColor outlineColor() const;
2014-01-26 18:35:21 +01:00
/** Set outline color.
* @note added in 2.1 */
2014-01-27 09:22:24 +01:00
void setOutlineColor( const QColor& color );
2014-01-26 18:35:21 +01:00
/** Get fill color.
* @note added in 2.1 */
2014-01-27 09:22:24 +01:00
QColor fillColor() const;
2014-01-26 18:35:21 +01:00
/** Set fill color.
* @note added in 2.1 */
2014-01-27 09:22:24 +01:00
void setFillColor( const QColor& color );
2014-01-12 18:17:20 +01:00
2012-09-24 02:28:15 +02:00
Qt::PenStyle borderStyle() const;
void setBorderStyle( Qt::PenStyle borderStyle );
double borderWidth() const;
void setBorderWidth( double borderWidth );
2014-05-07 19:02:11 +02:00
2014-03-17 18:42:41 +11:00
Qt::PenJoinStyle penJoinStyle() const;
void setPenJoinStyle( Qt::PenJoinStyle style );
2012-09-24 02:28:15 +02:00
void setOffset( QPointF offset );
QPointF offset();
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the width of the fill's border.
* @param unit width units
* @see borderWidthUnit()
*/
2016-07-17 22:11:17 +10:00
void setBorderWidthUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the width of the fill's border.
* @see setBorderWidthUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit borderWidthUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setBorderWidthMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& borderWidthMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the fill's offset.
* @param unit offset units
* @see offsetUnit()
*/
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the fill's offset.
* @see setOffsetUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& offsetMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale &scale );
2014-04-06 21:14:02 +02:00
QgsMapUnitScale mapUnitScale() const;
2014-01-26 18:35:21 +01:00
double estimateMaxBleed() const;
2016-08-05 08:09:43 +02:00
double dxfWidth( const QgsDxfExport& e, QgsSymbolRenderContext& context ) const;
QColor dxfColor( QgsSymbolRenderContext& context ) const;
2014-01-26 18:35:21 +01:00
Qt::PenStyle dxfPenStyle() const;
2016-08-05 08:09:43 +02:00
QColor dxfBrushColor( QgsSymbolRenderContext& context ) const;
2015-02-03 02:21:52 +01:00
Qt::BrushStyle dxfBrushStyle() const;
2012-09-24 02:28:15 +02:00
};
2016-08-06 11:01:42 +02:00
class QgsGradientFillSymbolLayer : QgsFillSymbolLayer
2013-09-08 22:03:04 +10:00
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
2014-05-27 23:22:50 +02:00
2013-09-08 22:03:04 +10:00
enum GradientColorType
{
SimpleTwoColor,
ColorRamp
};
enum GradientType
{
Linear,
Radial,
Conical
};
enum GradientCoordinateMode
{
Feature,
Viewport
};
enum GradientSpread
{
Pad,
Reflect,
Repeat
};
2014-01-03 23:06:49 +01:00
2016-08-06 11:01:42 +02:00
QgsGradientFillSymbolLayer( const QColor& color = DEFAULT_SIMPLEFILL_COLOR,
2015-10-07 18:32:24 +11:00
const QColor& color2 = Qt::white,
2013-09-08 22:03:04 +10:00
GradientColorType gradientColorType = SimpleTwoColor,
GradientType gradientType = Linear,
GradientCoordinateMode coordinateMode = Feature,
2014-01-03 23:06:49 +01:00
GradientSpread gradientSpread = Pad
);
2014-01-27 09:22:24 +01:00
2016-08-06 11:01:42 +02:00
virtual ~QgsGradientFillSymbolLayer();
2014-01-27 09:22:24 +01:00
2013-09-08 22:03:04 +10:00
// static stuff
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
2013-09-08 22:03:04 +10:00
// implemented from base classes
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2013-09-08 22:03:04 +10:00
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2013-09-08 22:03:04 +10:00
2016-08-05 08:09:43 +02:00
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolRenderContext& context );
2013-09-08 22:03:04 +10:00
QgsStringMap properties() const;
2016-08-06 11:01:42 +02:00
virtual QgsGradientFillSymbolLayer* clone() const /Factory/;
2013-09-08 22:03:04 +10:00
2014-01-27 09:22:24 +01:00
double estimateMaxBleed() const;
2015-07-29 11:52:14 +02:00
/** Type of gradient, eg linear or radial*/
2013-09-08 22:03:04 +10:00
GradientType gradientType() const;
void setGradientType( GradientType gradientType );
2015-07-29 11:52:14 +02:00
/** Gradient color mode, controls how gradient color stops are created*/
2013-09-08 22:03:04 +10:00
GradientColorType gradientColorType() const;
void setGradientColorType( GradientColorType gradientColorType );
2015-07-29 11:52:14 +02:00
/** Color ramp used for the gradient fill, only used if the gradient color type is set to ColorRamp*/
2016-08-06 11:01:42 +02:00
QgsVectorColorRamp* colorRamp();
void setColorRamp( QgsVectorColorRamp* ramp );
2013-09-08 22:03:04 +10:00
2015-07-29 11:52:14 +02:00
/** Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor*/
2013-09-08 22:03:04 +10:00
QColor color2() const;
2015-10-07 18:32:24 +11:00
void setColor2( const QColor& color2 );
2013-09-08 22:03:04 +10:00
2015-07-29 11:52:14 +02:00
/** Coordinate mode for gradient. Controls how the gradient stops are positioned.*/
2013-09-08 22:03:04 +10:00
GradientCoordinateMode coordinateMode() const;
void setCoordinateMode( GradientCoordinateMode coordinateMode );
2015-07-29 11:52:14 +02:00
/** Gradient spread mode. Controls how the gradient behaves outside of the predefined stops*/
2013-09-08 22:03:04 +10:00
GradientSpread gradientSpread() const;
void setGradientSpread( GradientSpread gradientSpread );
2015-07-29 11:52:14 +02:00
/** Starting point of gradient fill, in the range [0,0] - [1,1]*/
2013-09-08 22:03:04 +10:00
void setReferencePoint1( QPointF referencePoint );
QPointF referencePoint1() const;
2014-01-03 23:06:49 +01:00
2015-07-29 11:52:14 +02:00
/** Sets the starting point of the gradient to be the feature centroid*/
2013-11-03 20:31:52 +11:00
void setReferencePoint1IsCentroid( bool isCentroid );
bool referencePoint1IsCentroid() const;
2013-09-08 22:03:04 +10:00
2015-07-29 11:52:14 +02:00
/** End point of gradient fill, in the range [0,0] - [1,1]*/
2013-09-08 22:03:04 +10:00
void setReferencePoint2( QPointF referencePoint );
QPointF referencePoint2() const;
2014-01-03 23:06:49 +01:00
2015-07-29 11:52:14 +02:00
/** Sets the end point of the gradient to be the feature centroid*/
2013-11-03 20:31:52 +11:00
void setReferencePoint2IsCentroid( bool isCentroid );
2014-01-03 23:06:49 +01:00
bool referencePoint2IsCentroid() const;
2013-09-08 22:03:04 +10:00
2015-07-29 11:52:14 +02:00
/** Offset for gradient fill*/
2013-09-08 22:03:04 +10:00
void setOffset( QPointF offset );
QPointF offset() const;
2015-07-29 11:52:14 +02:00
/** Units for gradient fill offset*/
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit offsetUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& offsetMapUnitScale() const;
2014-05-07 19:02:11 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-04-06 21:14:02 +02:00
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale &scale );
2014-04-06 21:14:02 +02:00
QgsMapUnitScale mapUnitScale() const;
2014-01-03 23:06:49 +01:00
2013-09-08 22:03:04 +10:00
};
2016-08-06 11:01:42 +02:00
class QgsShapeburstFillSymbolLayer : QgsFillSymbolLayer
2014-03-21 12:50:50 +11:00
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
2014-05-27 23:22:50 +02:00
2014-03-21 12:50:50 +11:00
enum ShapeburstColorType
{
SimpleTwoColor,
ColorRamp
};
2016-08-06 11:01:42 +02:00
QgsShapeburstFillSymbolLayer( const QColor& color = DEFAULT_SIMPLEFILL_COLOR, const QColor& color2 = Qt::white,
2014-03-21 12:50:50 +11:00
ShapeburstColorType colorType = SimpleTwoColor,
2014-05-07 19:02:11 +02:00
int blurRadius = 0, bool useWholeShape = true, double maxDistance = 5 );
2014-03-21 12:50:50 +11:00
2016-08-06 11:01:42 +02:00
virtual ~QgsShapeburstFillSymbolLayer();
2014-03-21 12:50:50 +11:00
// static stuff
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
2014-03-21 12:50:50 +11:00
// implemented from base classes
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2014-03-21 12:50:50 +11:00
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2014-03-21 12:50:50 +11:00
2016-08-05 08:09:43 +02:00
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolRenderContext& context );
2014-03-21 12:50:50 +11:00
QgsStringMap properties() const;
2016-08-06 11:01:42 +02:00
virtual QgsShapeburstFillSymbolLayer* clone() const /Factory/;
2014-03-21 12:50:50 +11:00
double estimateMaxBleed() const;
2015-07-29 11:52:14 +02:00
/** Sets the blur radius, which controls the amount of blurring applied to the fill.
2014-03-21 12:50:50 +11:00
* @param blurRadius Radius for fill blur. Values between 0 - 17 are valid, where higher values results in a stronger blur. Set to 0 to disable blur.
* @note added in 2.3
* @see blurRadius
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
void setBlurRadius( int blurRadius );
2015-07-29 11:52:14 +02:00
/** Returns the blur radius, which controls the amount of blurring applied to the fill.
2014-03-21 12:50:50 +11:00
* @returns Integer representing the radius for fill blur. Higher values indicate a stronger blur. A 0 value indicates that blurring is disabled.
* @note added in 2.3
* @see setBlurRadius
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
int blurRadius() const;
2015-07-29 11:52:14 +02:00
/** Sets whether the shapeburst fill should be drawn using the entire shape.
2014-03-21 12:50:50 +11:00
* @param useWholeShape Set to true if shapeburst should cover entire shape. If false, setMaxDistance is used to calculate how far from the boundary of the shape should
* be shaded
* @note added in 2.3
* @see useWholeShape
* @see setMaxDistance
2016-02-14 03:50:23 +01:00
*/
2014-11-19 19:40:51 +11:00
void setUseWholeShape( bool useWholeShape );
2015-07-29 11:52:14 +02:00
/** Returns whether the shapeburst fill is set to cover the entire shape.
2014-03-21 12:50:50 +11:00
* @returns True if shapeburst fill will cover the entire shape. If false, shapeburst is drawn to a distance of maxDistance from the polygon's boundary.
* @note added in 2.3
* @see setUseWholeShape
* @see maxDistance
2016-02-14 03:50:23 +01:00
*/
2014-11-19 19:40:51 +11:00
bool useWholeShape() const;
2014-03-21 12:50:50 +11:00
2015-07-29 11:52:14 +02:00
/** Sets the maximum distance to shape inside of the shape from the polygon's boundary.
2014-03-21 12:50:50 +11:00
* @param maxDistance distance from boundary to shade. setUseWholeShape must be set to false for this parameter to take effect. Distance unit is controlled by setDistanceUnit.
* @note added in 2.3
* @see maxDistance
* @see setUseWholeShape
* @see setDistanceUnit
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
void setMaxDistance( double maxDistance );
2015-07-29 11:52:14 +02:00
/** Returns the maximum distance from the shape's boundary which is shaded. This parameter is only effective if useWholeShape is false.
2014-03-21 12:50:50 +11:00
* @returns the maximum distance from the polygon's boundary which is shaded. Distance units are indicated by distanceUnit.
* @note added in 2.3
* @see useWholeShape
* @see setMaxDistance
* @see distanceUnit
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
double maxDistance() const;
2015-07-29 11:52:14 +02:00
/** Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
2014-03-21 12:50:50 +11:00
* @param unit distance unit for the maximum distance
* @note added in 2.3
* @see setMaxDistance
* @see distanceUnit
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
void setDistanceUnit( QgsUnitTypes::RenderUnit unit );
2015-07-29 11:52:14 +02:00
/** Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
2014-03-21 12:50:50 +11:00
* @returns distance unit for the maximum distance
* @note added in 2.3
* @see maxDistance
* @see setDistanceUnit
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceUnit() const;
2014-03-21 12:50:50 +11:00
2014-05-07 19:02:11 +02:00
void setDistanceMapUnitScale( const QgsMapUnitScale& scale );
const QgsMapUnitScale& distanceMapUnitScale() const;
2016-08-06 11:01:42 +02:00
/** Sets the color mode to use for the shapeburst fill. Shapeburst can either be drawn using a QgsVectorColorRamp color ramp
2014-03-21 12:50:50 +11:00
* or by simply specificing a start and end color. setColorType is used to specify which mode to use for the fill.
* @param colorType color type to use for shapeburst fill
* @note added in 2.3
* @see colorType
* @see setColor
* @see setColor2
* @see setColorRamp
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
void setColorType( ShapeburstColorType colorType );
2016-08-06 11:01:42 +02:00
/** Returns the color mode used for the shapeburst fill. Shapeburst can either be drawn using a QgsVectorColorRamp color ramp
2014-03-21 12:50:50 +11:00
* or by simply specificing a start and end color.
* @returns current color mode used for the shapeburst fill
* @note added in 2.3
* @see setColorType
* @see color
* @see color2
* @see colorRamp
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
ShapeburstColorType colorType() const;
2015-07-29 11:52:14 +02:00
/** Sets the color ramp used to draw the shapeburst fill. Color ramps are only used if setColorType is set ShapeburstColorType::ColorRamp.
2014-03-21 12:50:50 +11:00
* @param ramp color ramp to use for shapeburst fill
* @note added in 2.3
* @see setColorType
* @see colorRamp
2016-02-14 03:50:23 +01:00
*/
2016-08-06 11:01:42 +02:00
void setColorRamp( QgsVectorColorRamp* ramp );
2015-07-29 11:52:14 +02:00
/** Returns the color ramp used for the shapeburst fill. The color ramp is only used if the colorType is set to ShapeburstColorType::ColorRamp
2016-08-06 11:01:42 +02:00
* @returns a QgsVectorColorRamp color ramp
2014-03-21 12:50:50 +11:00
* @note added in 2.3
* @see setColorRamp
* @see colorType
2016-02-14 03:50:23 +01:00
*/
2016-08-06 11:01:42 +02:00
QgsVectorColorRamp* colorRamp();
2014-03-21 12:50:50 +11:00
2015-07-29 11:52:14 +02:00
/** Sets the color for the endpoint of the shapeburst fill. This color is only used if setColorType is set ShapeburstColorType::SimpleTwoColor.
2014-03-21 12:50:50 +11:00
* @param color2 QColor to use for endpoint of gradient
* @note added in 2.3
* @see setColorType
* @see color2
2016-02-14 03:50:23 +01:00
*/
2015-10-07 18:32:24 +11:00
void setColor2( const QColor& color2 );
2015-07-29 11:52:14 +02:00
/** Returns the color used for the endpoint of the shapeburst fill. This color is only used if the colorType is set to ShapeburstColorType::SimpleTwoColor
2014-03-21 12:50:50 +11:00
* @returns a QColor indicating the color of the endpoint of the gradient
* @note added in 2.3
* @see setColor2
* @see colorType
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
QColor color2() const;
2014-05-07 19:02:11 +02:00
2015-07-29 11:52:14 +02:00
/** Sets whether the shapeburst fill should ignore polygon rings when calculating
2014-03-22 07:35:24 +11:00
* the buffered shading.
* @param ignoreRings Set to true if buffers should ignore interior rings for polygons.
* @note added in 2.3
* @see ignoreRings
2016-02-14 03:50:23 +01:00
*/
2014-11-19 19:40:51 +11:00
void setIgnoreRings( bool ignoreRings );
2015-07-29 11:52:14 +02:00
/** Returns whether the shapeburst fill is set to ignore polygon interior rings.
2014-03-22 07:35:24 +11:00
* @returns True if the shapeburst fill will ignore interior rings when calculating buffered shading.
* @note added in 2.3
* @see setIgnoreRings
2016-02-14 03:50:23 +01:00
*/
2014-11-19 19:40:51 +11:00
bool ignoreRings() const;
2014-03-21 12:50:50 +11:00
2015-07-29 11:52:14 +02:00
/** Sets the offset for the shapeburst fill.
2014-03-21 12:50:50 +11:00
* @param offset QPointF indicating the horizontal/vertical offset amount
* @note added in 2.3
* @see offset
* @see setOffsetUnit
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
void setOffset( QPointF offset );
2015-07-29 11:52:14 +02:00
/** Returns the offset for the shapeburst fill.
2014-03-21 12:50:50 +11:00
* @returns a QPointF indicating the horizontal/vertical offset amount
* @note added in 2.3
* @see setOffset
* @see offsetUnit
2016-02-14 03:50:23 +01:00
*/
2014-03-21 12:50:50 +11:00
QPointF offset() const;
2015-07-29 11:52:14 +02:00
/** Sets the units used for the offset for the shapeburst fill.
2014-03-21 12:50:50 +11:00
* @param unit units for fill offset
* @note added in 2.3
* @see setOffset
* @see offsetUnit
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2015-07-29 11:52:14 +02:00
/** Returns the units used for the offset of the shapeburst fill.
2014-03-21 12:50:50 +11:00
* @returns units used for the fill offset
* @note added in 2.3
* @see offset
* @see setOffsetUnit
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& offsetMapUnitScale() const;
2014-03-21 12:50:50 +11:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale &scale );
QgsMapUnitScale mapUnitScale() const;
2014-03-21 12:50:50 +11:00
};
2015-07-29 11:52:14 +02:00
/** Base class for polygon renderers generating texture images*/
2016-08-06 11:01:42 +02:00
class QgsImageFillSymbolLayer: QgsFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
QgsImageFillSymbolLayer();
virtual ~QgsImageFillSymbolLayer();
2016-08-05 08:09:43 +02:00
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
virtual QgsSymbol* subSymbol();
virtual bool setSubSymbol( QgsSymbol* symbol /Transfer/ );
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the symbol's outline width.
* @param unit symbol units
* @see outlineWidthUnit()
*/
2016-07-17 22:11:17 +10:00
void setOutlineWidthUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the symbol's outline width.
* @see setOutlineWidthUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit outlineWidthUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setOutlineWidthMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& outlineWidthMapUnitScale() const;
2014-05-07 19:02:11 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-04-06 21:14:02 +02:00
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale& scale );
2014-04-06 21:14:02 +02:00
QgsMapUnitScale mapUnitScale() const;
2014-01-27 09:22:24 +01:00
virtual double estimateMaxBleed() const;
2016-08-05 08:09:43 +02:00
virtual double dxfWidth( const QgsDxfExport& e, QgsSymbolRenderContext& context ) const;
virtual QColor dxfColor( QgsSymbolRenderContext& context ) const;
2014-01-27 09:22:24 +01:00
virtual Qt::PenStyle dxfPenStyle() const;
2015-11-04 16:03:46 +11:00
QSet<QString> usedAttributes() const;
2016-01-04 22:51:18 +11:00
protected:
2016-08-05 08:09:43 +02:00
virtual void applyDataDefinedSettings( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
};
2014-11-17 23:30:00 +11:00
/** \ingroup core
* \class QgsRasterFillSymbolLayer
* \brief A class for filling symbols with a repeated raster image.
* \note Added in version 2.7
*/
class QgsRasterFillSymbolLayer: QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
enum FillCoordinateMode
{
Feature,
Viewport
};
QgsRasterFillSymbolLayer( const QString& imageFilePath = QString() );
~QgsRasterFillSymbolLayer();
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() );
2014-11-17 23:30:00 +11:00
// implemented from base classes
QString layerType() const;
2016-08-05 08:09:43 +02:00
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolRenderContext& context );
void startRender( QgsSymbolRenderContext& context );
void stopRender( QgsSymbolRenderContext& context );
2014-11-17 23:30:00 +11:00
QgsStringMap properties() const;
2015-11-12 19:35:14 +11:00
virtual QgsRasterFillSymbolLayer* clone() const;
2014-11-17 23:30:00 +11:00
virtual double estimateMaxBleed() const;
//override QgsImageFillSymbolLayer's support for sub symbols
2016-08-05 08:09:43 +02:00
virtual QgsSymbol* subSymbol();
virtual bool setSubSymbol( QgsSymbol* symbol /Transfer/ );
2014-11-17 23:30:00 +11:00
2015-07-29 11:52:14 +02:00
/** Sets the path to the raster image used for the fill.
2014-11-17 23:30:00 +11:00
* @param imagePath path to image file
* @see imageFilePath
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
void setImageFilePath( const QString& imagePath );
2015-07-29 11:52:14 +02:00
/** The path to the raster image used for the fill.
2014-11-17 23:30:00 +11:00
* @returns path to image file
* @see setImageFilePath
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
QString imageFilePath() const;
2015-07-29 11:52:14 +02:00
/** Set the coordinate mode for fill. Controls how the top left corner of the image
2014-11-17 23:30:00 +11:00
* fill is positioned relative to the feature.
* @param mode coordinate mode
* @see coordinateMode
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
void setCoordinateMode( const FillCoordinateMode mode );
2015-07-29 11:52:14 +02:00
/** Coordinate mode for fill. Controls how the top left corner of the image
2014-11-17 23:30:00 +11:00
* fill is positioned relative to the feature.
* @returns coordinate mode
* @see setCoordinateMode
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
FillCoordinateMode coordinateMode() const;
2015-07-29 11:52:14 +02:00
/** Sets the opacity for the raster image used in the fill.
2014-11-17 23:30:00 +11:00
* @param alpha opacity value between 0 (fully transparent) and 1 (fully opaque)
* @see alpha
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
void setAlpha( const double alpha );
2015-07-29 11:52:14 +02:00
/** The opacity for the raster image used in the fill.
2014-11-17 23:30:00 +11:00
* @returns opacity value between 0 (fully transparent) and 1 (fully opaque)
* @see setAlpha
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
double alpha() const;
2015-07-29 11:52:14 +02:00
/** Sets the offset for the fill.
2014-11-17 23:30:00 +11:00
* @param offset offset for fill
* @see offset
* @see setOffsetUnit
* @see setOffsetMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2016-02-02 19:46:18 +11:00
void setOffset( QPointF offset );
2015-07-29 11:52:14 +02:00
/** Returns the offset for the fill.
2014-11-17 23:30:00 +11:00
* @returns offset for fill
* @see setOffset
* @see offsetUnit
* @see offsetMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
QPointF offset() const;
2015-07-29 11:52:14 +02:00
/** Sets the units for the fill's offset.
2014-11-17 23:30:00 +11:00
* @param unit units for offset
* @see offsetUnit
* @see setOffset
* @see setOffsetMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
void setOffsetUnit( const QgsUnitTypes::RenderUnit unit );
2015-07-29 11:52:14 +02:00
/** Returns the units for the fill's offset.
2014-11-17 23:30:00 +11:00
* @returns units for offset
* @see setOffsetUnit
* @see offset
* @see offsetMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2014-11-17 23:30:00 +11:00
2015-07-29 11:52:14 +02:00
/** Sets the map unit scale for the fill's offset.
2014-11-17 23:30:00 +11:00
* @param scale map unit scale for offset
* @see offsetMapUnitScale
* @see setOffset
* @see setOffsetUnit
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
void setOffsetMapUnitScale( const QgsMapUnitScale& scale );
2015-07-29 11:52:14 +02:00
/** Returns the map unit scale for the fill's offset.
2014-11-17 23:30:00 +11:00
* @returns map unit scale for offset
* @see setOffsetMapUnitScale
* @see offset
* @see offsetUnit
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
const QgsMapUnitScale& offsetMapUnitScale() const;
2015-07-29 11:52:14 +02:00
/** Sets the width for scaling the image used in the fill. The image's height will also be
2014-11-17 23:30:00 +11:00
* scaled to maintain the image's aspect ratio.
* @param width width for scaling the image
* @see width
* @see setWidthUnit
* @see setWidthMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
void setWidth( const double width );
2015-07-29 11:52:14 +02:00
/** Returns the width used for scaling the image used in the fill. The image's height is
2014-11-17 23:30:00 +11:00
* scaled to maintain the image's aspect ratio.
* @returns width used for scaling the image
* @see setWidth
* @see widthUnit
* @see widthMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
double width() const;
2015-07-29 11:52:14 +02:00
/** Sets the units for the image's width.
2014-11-17 23:30:00 +11:00
* @param unit units for width
* @see widthUnit
* @see setWidth
* @see setWidthMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
void setWidthUnit( const QgsUnitTypes::RenderUnit unit );
2015-07-29 11:52:14 +02:00
/** Returns the units for the image's width.
2014-11-17 23:30:00 +11:00
* @returns units for width
* @see setWidthUnit
* @see width
* @see widthMapUnitScale
2016-02-14 03:50:23 +01:00
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit widthUnit() const;
2014-11-17 23:30:00 +11:00
2015-07-29 11:52:14 +02:00
/** Sets the map unit scale for the image's width.
2014-11-17 23:30:00 +11:00
* @param scale map unit scale for width
* @see widthMapUnitScale
* @see setWidth
* @see setWidthUnit
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
void setWidthMapUnitScale( const QgsMapUnitScale& scale );
2015-07-29 11:52:14 +02:00
/** Returns the map unit scale for the image's width.
2014-11-17 23:30:00 +11:00
* @returns map unit scale for width
* @see setWidthMapUnitScale
* @see width
* @see widthUnit
2016-02-14 03:50:23 +01:00
*/
2014-11-17 23:30:00 +11:00
const QgsMapUnitScale& widthMapUnitScale() const;
protected:
2016-08-05 08:09:43 +02:00
void applyDataDefinedSettings( QgsSymbolRenderContext& context );
2014-11-17 23:30:00 +11:00
};
2015-07-29 11:52:14 +02:00
/** A class for svg fill patterns. The class automatically scales the pattern to
2012-09-24 02:28:15 +02:00
the appropriate pixel dimensions of the output device*/
class QgsSVGFillSymbolLayer: QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
QgsSVGFillSymbolLayer( const QString& svgFilePath = "", double width = 20, double rotation = 0.0 );
QgsSVGFillSymbolLayer( const QByteArray& svgData, double width = 20, double rotation = 0.0 );
~QgsSVGFillSymbolLayer();
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer* createFromSld( QDomElement &element ) /Factory/;
2012-09-24 02:28:15 +02:00
// implemented from base classes
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
void stopRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
QgsStringMap properties() const;
2015-11-12 19:35:14 +11:00
virtual QgsSVGFillSymbolLayer* clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2015-10-07 11:55:34 +11:00
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const;
2012-09-24 02:28:15 +02:00
//getters and setters
void setSvgFilePath( const QString& svgPath );
QString svgFilePath() const;
void setPatternWidth( double width );
double patternWidth() const;
void setSvgFillColor( const QColor& c );
QColor svgFillColor() const;
void setSvgOutlineColor( const QColor& c );
QColor svgOutlineColor() const;
void setSvgOutlineWidth( double w );
double svgOutlineWidth() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the width of the SVG images in the pattern.
* @param unit width units
* @see patternWidthUnit()
*/
2016-07-17 22:11:17 +10:00
void setPatternWidthUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the width of the SVG images in the pattern.
* @see setPatternWidthUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit patternWidthUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setPatternWidthMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& patternWidthMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the outline width.
* @param unit width units
* @see svgOutlineWidthUnit()
*/
2016-07-17 22:11:17 +10:00
void setSvgOutlineWidthUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the outline width.
* @see setSvgOutlineWidthUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit svgOutlineWidthUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setSvgOutlineWidthMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& svgOutlineWidthMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2013-04-19 15:20:44 +02:00
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale &scale );
QgsMapUnitScale mapUnitScale() const;
2013-06-23 16:00:16 +02:00
protected:
2016-08-05 08:09:43 +02:00
void applyDataDefinedSettings( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
};
class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
QgsLinePatternFillSymbolLayer();
~QgsLinePatternFillSymbolLayer();
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer* createFromSld( QDomElement &element ) /Factory/;
2012-09-24 02:28:15 +02:00
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
QgsStringMap properties() const;
2015-11-12 19:35:14 +11:00
virtual QgsLinePatternFillSymbolLayer* clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2015-10-07 11:55:34 +11:00
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const;
2012-09-24 02:28:15 +02:00
2014-01-27 09:22:24 +01:00
double estimateMaxBleed() const;
2013-06-23 16:00:16 +02:00
QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
2012-09-24 02:28:15 +02:00
//getters and setters
void setLineAngle( double a );
double lineAngle() const;
2016-07-18 09:42:45 +10:00
/** Sets the distance between lines in the fill pattern.
* @param d distance. Units are specified by setDistanceUnit()
* @see distance()
* @see setDistanceUnit()
*/
2012-09-24 02:28:15 +02:00
void setDistance( double d );
2016-07-18 09:42:45 +10:00
/** Returns the distance between lines in the fill pattern. Units are retrieved by distanceUnit().
* @see setDistance()
* @see distanceUnit()
*/
2012-09-24 02:28:15 +02:00
double distance() const;
void setLineWidth( double w );
double lineWidth() const;
void setColor( const QColor& c );
QColor color() const;
void setOffset( double offset );
double offset() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the distance between lines in the fill pattern.
* @param unit distance units
* @see distanceUnit()
* @see setDistance()
*/
2016-07-17 22:11:17 +10:00
void setDistanceUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the distance between lines in the fill pattern.
* @see setDistanceUnit()
* @see distance()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setDistanceMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& distanceMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the line's width.
* @param unit width units
* @see lineWidthUnit()
*/
2016-07-17 22:11:17 +10:00
void setLineWidthUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the line's width.
* @see setLineWidthUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit lineWidthUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setLineWidthMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& lineWidthMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the line pattern's offset.
* @param unit offset units
* @see offsetUnit()
*/
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the line pattern's offset.
* @see setOffsetUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& offsetMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale& scale );
2014-04-06 21:14:02 +02:00
QgsMapUnitScale mapUnitScale() const;
2014-01-27 09:22:24 +01:00
2016-08-05 08:09:43 +02:00
bool setSubSymbol( QgsSymbol* symbol /Transfer/ );
QgsSymbol* subSymbol();
2014-01-27 09:22:24 +01:00
2015-05-19 16:54:37 +10:00
QSet<QString> usedAttributes() const;
2012-09-24 02:28:15 +02:00
};
class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
QgsPointPatternFillSymbolLayer();
~QgsPointPatternFillSymbolLayer();
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer* createFromSld( QDomElement &element ) /Factory/;
2012-09-24 02:28:15 +02:00
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
QgsStringMap properties() const;
2015-11-12 19:35:14 +11:00
virtual QgsPointPatternFillSymbolLayer* clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2015-10-07 11:55:34 +11:00
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const;
2012-09-24 02:28:15 +02:00
2014-01-27 09:22:24 +01:00
double estimateMaxBleed() const;
2012-09-24 02:28:15 +02:00
//getters and setters
double distanceX() const;
void setDistanceX( double d );
double distanceY() const;
void setDistanceY( double d );
double displacementX() const;
void setDisplacementX( double d );
double displacementY() const;
void setDisplacementY( double d );
2016-08-05 08:09:43 +02:00
bool setSubSymbol( QgsSymbol* symbol /Transfer/ );
virtual QgsSymbol* subSymbol();
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the horizontal distance between points in the pattern.
* @param unit distance units
* @see distanceXUnit()
* @see setDistanceYUnit()
*/
2016-07-17 22:11:17 +10:00
void setDistanceXUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the horizontal distance between points in the pattern.
* @see setDistanceXUnit()
* @see distanceYUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceXUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setDistanceXMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& distanceXMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-18 09:42:45 +10:00
/** Sets the units for the vertical distance between points in the pattern.
* @param unit distance units
* @see distanceYUnit()
* @see setDistanceXUnit()
*/
2016-07-17 22:11:17 +10:00
void setDistanceYUnit( QgsUnitTypes::RenderUnit unit );
2016-07-18 09:42:45 +10:00
/** Returns the units for the vertical distance between points in the pattern.
* @see setDistanceYUnit()
* @see distanceXUnit()
*/
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceYUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setDistanceYMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& distanceYMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDisplacementXUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit displacementXUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setDisplacementXMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& displacementXMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDisplacementYUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit displacementYUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setDisplacementYMapUnitScale( const QgsMapUnitScale& scale);
const QgsMapUnitScale& displacementYMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-05-07 19:02:11 +02:00
void setMapUnitScale( const QgsMapUnitScale &scale );
2014-04-06 21:14:02 +02:00
QgsMapUnitScale mapUnitScale() const;
2013-06-23 16:00:16 +02:00
2014-01-27 09:22:24 +01:00
virtual QSet<QString> usedAttributes() const;
2016-05-07 21:52:05 +10:00
void setColor( const QColor& c );
virtual QColor color() const;
2013-06-23 16:00:16 +02:00
protected:
2016-08-05 08:09:43 +02:00
void applyDataDefinedSettings( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
};
2016-08-06 11:01:42 +02:00
class QgsCentroidFillSymbolLayer : QgsFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End
public:
2016-08-06 11:01:42 +02:00
QgsCentroidFillSymbolLayer();
~QgsCentroidFillSymbolLayer();
2012-09-24 02:28:15 +02:00
// static stuff
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer* createFromSld( QDomElement &element ) /Factory/;
2012-09-24 02:28:15 +02:00
// implemented from base classes
QString layerType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolRenderContext& context );
2012-09-24 02:28:15 +02:00
QgsStringMap properties() const;
2016-08-06 11:01:42 +02:00
virtual QgsCentroidFillSymbolLayer* clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2015-10-07 11:55:34 +11:00
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap& props ) const;
2012-09-24 02:28:15 +02:00
void setColor( const QColor& color );
2016-05-07 21:52:05 +10:00
QColor color() const;
2012-09-24 02:28:15 +02:00
2016-08-05 08:09:43 +02:00
QgsSymbol* subSymbol();
bool setSubSymbol( QgsSymbol* symbol /Transfer/ );
2013-06-23 16:00:16 +02:00
2016-07-17 22:11:17 +10:00
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
void setMapUnitScale(const QgsMapUnitScale &scale);
QgsMapUnitScale mapUnitScale() const;
2014-01-27 09:22:24 +01:00
virtual QSet<QString> usedAttributes() const;
2015-11-10 17:08:27 +11:00
void setPointOnSurface( bool pointOnSurface );
bool pointOnSurface() const;
2016-04-23 21:40:36 +07:00
/** Sets whether a point is drawn for all parts or only on the biggest part of multi-part features.
* @note added in 2.16 */
void setPointOnAllParts( bool pointOnAllParts );
/** Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
* @note added in 2.16 */
bool pointOnAllParts() const;
2012-09-24 02:28:15 +02:00
};