2012-09-24 02:28:15 +02:00
|
|
|
class QgsSimpleFillSymbolLayerV2 : QgsFillSymbolLayerV2
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfillsymbollayerv2.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
QgsSimpleFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR,
|
|
|
|
Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
|
|
|
|
QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
|
|
|
|
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
|
|
|
|
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH );
|
|
|
|
|
|
|
|
// static stuff
|
|
|
|
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
|
|
|
|
static QgsSymbolLayerV2* createFromSld( QDomElement &element ) /Factory/;
|
|
|
|
|
|
|
|
// implemented from base classes
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const /Factory/;
|
|
|
|
|
|
|
|
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
|
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;
|
|
|
|
void setBorderColor( QColor borderColor );
|
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
/** Get outline color.
|
|
|
|
* @note added in 2.1 */
|
2014-01-12 18:17:20 +01:00
|
|
|
virtual QColor outlineColor() const;
|
2014-01-26 18:35:21 +01:00
|
|
|
/** Set outline color.
|
|
|
|
* @note added in 2.1 */
|
2014-01-12 18:17:20 +01:00
|
|
|
virtual void setOutlineColor( const QColor& color );
|
2014-01-26 18:35:21 +01:00
|
|
|
|
|
|
|
/** Get fill color.
|
|
|
|
* @note added in 2.1 */
|
2014-01-12 18:17:20 +01:00
|
|
|
virtual QColor fillColor() const;
|
2014-01-26 18:35:21 +01:00
|
|
|
/** Set fill color.
|
|
|
|
* @note added in 2.1 */
|
2014-01-12 18:17:20 +01:00
|
|
|
virtual void setFillColor( const QColor& color );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
Qt::PenStyle borderStyle() const;
|
|
|
|
void setBorderStyle( Qt::PenStyle borderStyle );
|
|
|
|
|
|
|
|
double borderWidth() const;
|
|
|
|
void setBorderWidth( double borderWidth );
|
|
|
|
|
|
|
|
void setOffset( QPointF offset );
|
|
|
|
QPointF offset();
|
2013-04-19 15:20:44 +02:00
|
|
|
|
|
|
|
void setBorderWidthUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit borderWidthUnit() const;
|
|
|
|
|
|
|
|
void setOffsetUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit offsetUnit() const;
|
|
|
|
|
|
|
|
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit outputUnit() const;
|
2014-01-26 18:35:21 +01:00
|
|
|
|
|
|
|
double estimateMaxBleed() const;
|
|
|
|
|
|
|
|
double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& context ) const;
|
|
|
|
QColor dxfColor( const QgsSymbolV2RenderContext& context ) const;
|
|
|
|
Qt::PenStyle dxfPenStyle() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
2013-09-08 22:03:04 +10:00
|
|
|
class QgsGradientFillSymbolLayerV2 : QgsFillSymbolLayerV2
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfillsymbollayerv2.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
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
|
|
|
|
2013-09-08 22:03:04 +10:00
|
|
|
QgsGradientFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR,
|
|
|
|
QColor color2 = Qt::white,
|
|
|
|
GradientColorType gradientColorType = SimpleTwoColor,
|
|
|
|
GradientType gradientType = Linear,
|
|
|
|
GradientCoordinateMode coordinateMode = Feature,
|
2014-01-03 23:06:49 +01:00
|
|
|
GradientSpread gradientSpread = Pad
|
|
|
|
);
|
2013-09-08 22:03:04 +10:00
|
|
|
// static stuff
|
|
|
|
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
|
|
|
|
|
|
|
|
// implemented from base classes
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const /Factory/;
|
|
|
|
|
2014-01-03 23:06:49 +01:00
|
|
|
/**Type of gradient, eg linear or radial*/
|
2013-09-08 22:03:04 +10:00
|
|
|
GradientType gradientType() const;
|
|
|
|
void setGradientType( GradientType gradientType );
|
|
|
|
|
2014-01-03 23:06:49 +01: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 );
|
|
|
|
|
2014-01-03 23:06:49 +01:00
|
|
|
/**Color ramp used for the gradient fill, only used if the gradient color type is set to ColorRamp*/
|
2013-09-08 22:03:04 +10:00
|
|
|
QgsVectorColorRampV2* colorRamp();
|
|
|
|
void setColorRamp( QgsVectorColorRampV2* ramp );
|
|
|
|
|
2014-01-03 23:06:49 +01: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;
|
|
|
|
void setColor2( QColor color2 );
|
|
|
|
|
2014-01-03 23:06:49 +01: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 );
|
|
|
|
|
2014-01-03 23:06:49 +01: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 );
|
|
|
|
|
2014-01-03 23:06:49 +01: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
|
|
|
|
|
|
|
/**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
|
|
|
|
2014-01-03 23:06:49 +01: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
|
|
|
|
|
|
|
/**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
|
|
|
|
2014-01-03 23:06:49 +01:00
|
|
|
/**Rotation angle for gradient fill. Can be used to rotate a gradient around its centre point*/
|
2013-09-08 22:03:04 +10:00
|
|
|
void setAngle( double angle );
|
|
|
|
double angle() const;
|
|
|
|
|
2014-01-03 23:06:49 +01:00
|
|
|
/**Offset for gradient fill*/
|
2013-09-08 22:03:04 +10:00
|
|
|
void setOffset( QPointF offset );
|
|
|
|
QPointF offset() const;
|
|
|
|
|
2014-01-03 23:06:49 +01:00
|
|
|
/**Units for gradient fill offset*/
|
2013-09-08 22:03:04 +10:00
|
|
|
void setOffsetUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit offsetUnit() const;
|
2014-01-03 23:06:49 +01:00
|
|
|
|
2013-09-08 22:03:04 +10:00
|
|
|
};
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/**Base class for polygon renderers generating texture images*/
|
|
|
|
class QgsImageFillSymbolLayer: QgsFillSymbolLayerV2
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfillsymbollayerv2.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
QgsImageFillSymbolLayer();
|
|
|
|
virtual ~QgsImageFillSymbolLayer();
|
|
|
|
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
virtual QgsSymbolV2* subSymbol();
|
|
|
|
virtual bool setSubSymbol( QgsSymbolV2* symbol );
|
2013-04-19 15:20:44 +02:00
|
|
|
|
|
|
|
void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit outlineWidthUnit() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**A class for svg fill patterns. The class automatically scales the pattern to
|
|
|
|
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();
|
|
|
|
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
|
|
|
|
static QgsSymbolLayerV2* createFromSld( QDomElement &element ) /Factory/;
|
|
|
|
|
|
|
|
// implemented from base classes
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const /Factory/;
|
|
|
|
|
|
|
|
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
|
|
|
|
//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
|
|
|
|
|
|
|
void setPatternWidthUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit patternWidthUnit() const;
|
|
|
|
|
|
|
|
void setSvgOutlineWidthUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit svgOutlineWidthUnit() const;
|
|
|
|
|
|
|
|
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit outputUnit() const;
|
|
|
|
|
2013-06-23 16:00:16 +02:00
|
|
|
protected:
|
|
|
|
void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfillsymbollayerv2.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsLinePatternFillSymbolLayer();
|
|
|
|
~QgsLinePatternFillSymbolLayer();
|
|
|
|
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
|
|
|
|
static QgsSymbolLayerV2* createFromSld( QDomElement &element ) /Factory/;
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const /Factory/;
|
|
|
|
|
|
|
|
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) 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;
|
|
|
|
void setDistance( double d );
|
|
|
|
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
|
|
|
|
|
|
|
void setDistanceUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit distanceUnit() const;
|
|
|
|
|
|
|
|
void setLineWidthUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit lineWidthUnit() const;
|
|
|
|
|
|
|
|
void setOffsetUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit offsetUnit() const;
|
|
|
|
|
|
|
|
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit outputUnit() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfillsymbollayerv2.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsPointPatternFillSymbolLayer();
|
|
|
|
~QgsPointPatternFillSymbolLayer();
|
|
|
|
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
|
|
|
|
static QgsSymbolLayerV2* createFromSld( QDomElement &element ) /Factory/;
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const /Factory/;
|
|
|
|
|
|
|
|
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
|
|
|
|
//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 );
|
|
|
|
|
|
|
|
bool setSubSymbol( QgsSymbolV2* symbol );
|
|
|
|
virtual QgsSymbolV2* subSymbol();
|
2013-04-19 15:20:44 +02:00
|
|
|
|
|
|
|
void setDistanceXUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit distanceXUnit() const;
|
|
|
|
|
|
|
|
void setDistanceYUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit distanceYUnit() const;
|
|
|
|
|
|
|
|
void setDisplacementXUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit displacementXUnit() const;
|
|
|
|
|
|
|
|
void setDisplacementYUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit displacementYUnit() const;
|
|
|
|
|
|
|
|
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit outputUnit() const;
|
2013-06-23 16:00:16 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class QgsCentroidFillSymbolLayerV2 : QgsFillSymbolLayerV2
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfillsymbollayerv2.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
QgsCentroidFillSymbolLayerV2();
|
|
|
|
~QgsCentroidFillSymbolLayerV2();
|
|
|
|
|
|
|
|
// static stuff
|
|
|
|
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
|
|
|
|
static QgsSymbolLayerV2* createFromSld( QDomElement &element ) /Factory/;
|
|
|
|
|
|
|
|
// implemented from base classes
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const /Factory/;
|
|
|
|
|
|
|
|
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
|
|
|
|
void setColor( const QColor& color );
|
|
|
|
|
|
|
|
QgsSymbolV2* subSymbol();
|
|
|
|
bool setSubSymbol( QgsSymbolV2* symbol /Transfer/ );
|
2013-06-23 16:00:16 +02:00
|
|
|
|
|
|
|
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
|
|
|
|
QgsSymbolV2::OutputUnit outputUnit() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|