sipify core symbology part 2

This commit is contained in:
Denis Rouzaud 2017-06-07 16:07:17 +02:00
parent fcc06ce380
commit 866bfc3db6
12 changed files with 1900 additions and 1204 deletions

View File

@ -41,13 +41,6 @@ core/composer/qgspaperitem.sip
core/composer/qgsscalebarstyle.sip
core/composer/qgssingleboxscalebarstyle.sip
core/composer/qgsticksscalebarstyle.sip
core/symbology-ng/qgsrulebasedrenderer.sip
core/symbology-ng/qgssinglesymbolrenderer.sip
core/symbology-ng/qgsgeometrygeneratorsymbollayer.sip
core/symbology-ng/qgslinesymbollayer.sip
core/symbology-ng/qgsmarkersymbollayer.sip
core/symbology-ng/qgssymbollayer.sip
core/symbology-ng/qgssymbollayerregistry.sip
gui/qgsprojectionselectiondialog.sip
gui/qgsprojectionselectiontreewidget.sip
gui/qgsprojectionselectionwidget.sip

View File

@ -70,7 +70,7 @@ class QgsGeometryGeneratorSymbolLayer : QgsSymbolLayer
virtual QgsSymbol *subSymbol();
virtual bool setSubSymbol( QgsSymbol *symbol );
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;

View File

@ -1,109 +1,166 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgslinesymbollayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSimpleLineSymbolLayer : QgsLineSymbolLayer
{
%TypeHeaderCode
#include <qgslinesymbollayer.h>
#include "qgslinesymbollayer.h"
%End
public:
QgsSimpleLineSymbolLayer( const QColor& color = DEFAULT_SIMPLELINE_COLOR,
double width = DEFAULT_SIMPLELINE_WIDTH,
Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );
QgsSimpleLineSymbolLayer( const QColor &color = DEFAULT_SIMPLELINE_COLOR,
double width = DEFAULT_SIMPLELINE_WIDTH,
Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );
// static stuff
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
// implemented from base classes
QString layerType() const;
virtual QString layerType() const;
void startRender( QgsSymbolRenderContext &context );
void stopRender( QgsSymbolRenderContext &context );
virtual void startRender( QgsSymbolRenderContext &context );
void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
//overridden so that clip path can be set when using draw inside polygon option
void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual void stopRender( QgsSymbolRenderContext &context );
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
QgsStringMap properties() const;
virtual QgsSimpleLineSymbolLayer *clone() const /Factory/;
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
void setMapUnitScale( const QgsMapUnitScale &scale );
QgsMapUnitScale mapUnitScale() const;
virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
double estimateMaxBleed( const QgsRenderContext &context ) const;
// new stuff
Qt::PenStyle penStyle() const;
%Docstring
:rtype: Qt.PenStyle
%End
void setPenStyle( Qt::PenStyle style );
Qt::PenJoinStyle penJoinStyle() const;
%Docstring
:rtype: Qt.PenJoinStyle
%End
void setPenJoinStyle( Qt::PenJoinStyle style );
Qt::PenCapStyle penCapStyle() const;
%Docstring
:rtype: Qt.PenCapStyle
%End
void setPenCapStyle( Qt::PenCapStyle style );
bool useCustomDashPattern() const;
%Docstring
:rtype: bool
%End
void setUseCustomDashPattern( bool b );
/** Sets the units for lengths used in the custom dash pattern.
* @param unit length units
* @see customDashPatternUnit()
*/
void setCustomDashPatternUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the units for lengths used in the custom dash pattern.
\param unit length units
.. seealso:: customDashPatternUnit()
%End
/** Returns the units for lengths used in the custom dash pattern.
* @see setCustomDashPatternUnit()
*/
QgsUnitTypes::RenderUnit customDashPatternUnit() const;
%Docstring
Returns the units for lengths used in the custom dash pattern.
.. seealso:: setCustomDashPatternUnit()
:rtype: QgsUnitTypes.RenderUnit
%End
const QgsMapUnitScale &customDashPatternMapUnitScale() const;
void setCustomDashPatternMapUnitScale( const QgsMapUnitScale &scale);
%Docstring
:rtype: QgsMapUnitScale
%End
void setCustomDashPatternMapUnitScale( const QgsMapUnitScale &scale );
QVector<qreal> customDashVector() const;
%Docstring
:rtype: list of qreal
%End
void setCustomDashVector( const QVector<qreal> &vector );
//Returns true if the line should only be drawn inside the polygon
bool drawInsidePolygon() const;
//Set to true if the line should only be drawn inside the polygon
%Docstring
:rtype: bool
%End
void setDrawInsidePolygon( bool drawInsidePolygon );
QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
Qt::PenStyle dxfPenStyle() const;
virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
virtual Qt::PenStyle dxfPenStyle() const;
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
protected:
double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
QColor dxfColor( QgsSymbolRenderContext &context ) const;
};
/////////
class QgsMarkerLineSymbolLayer : QgsLineSymbolLayer
{
%TypeHeaderCode
#include <qgslinesymbollayer.h>
%End
%TypeHeaderCode
#include "qgslinesymbollayer.h"
%End
public:
QgsMarkerLineSymbolLayer( bool rotateMarker = DEFAULT_MARKERLINE_ROTATE,
double interval = DEFAULT_MARKERLINE_INTERVAL );
double interval = DEFAULT_MARKERLINE_INTERVAL );
~QgsMarkerLineSymbolLayer();
/**
* Defines how/where the marker should be placed on the line
*/
enum Placement
{
Interval,
@ -114,168 +171,204 @@ class QgsMarkerLineSymbolLayer : QgsLineSymbolLayer
CurvePoint
};
// static stuff
/**
* Create a new MarkerLineSymbolLayerV2
*
* @param properties A property map to deserialize saved information from properties()
*
* @return A new MarkerLineSymbolLayerV2
*/
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
Create a new MarkerLineSymbolLayerV2
\param properties A property map to deserialize saved information from properties()
:return: A new MarkerLineSymbolLayerV2
:rtype: QgsSymbolLayer
%End
/**
* Create a new MarkerLineSymbolLayerV2 from SLD
*
* @param element An SLD XML DOM element
*
* @return A new MarkerLineSymbolLayerV2
*/
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
%Docstring
Create a new MarkerLineSymbolLayerV2 from SLD
// implemented from base classes
\param element An SLD XML DOM element
QString layerType() const;
:return: A new MarkerLineSymbolLayerV2
:rtype: QgsSymbolLayer
%End
void startRender( QgsSymbolRenderContext &context );
void stopRender( QgsSymbolRenderContext &context );
virtual QString layerType() const;
void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual void startRender( QgsSymbolRenderContext &context );
QgsStringMap properties() const;
virtual QgsMarkerLineSymbolLayer *clone() const;
virtual void stopRender( QgsSymbolRenderContext &context );
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
void setColor( const QColor &color );
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
virtual QgsMarkerLineSymbolLayer *clone() const /Factory/;
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
virtual void setColor( const QColor &color );
virtual QColor color() const;
QgsSymbol *subSymbol();
bool setSubSymbol( QgsSymbol *symbol /Transfer/);
virtual QgsSymbol *subSymbol();
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
virtual void setWidth( double width );
virtual double width() const;
double estimateMaxBleed( const QgsRenderContext &context ) const;
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
// new stuff
/**
* Shall the marker be rotated.
*
* @return True if the marker should be rotated.
*/
bool rotateMarker() const;
%Docstring
Shall the marker be rotated.
:return: True if the marker should be rotated.
:rtype: bool
%End
/**
* Shall the marker be rotated.
*/
void setRotateMarker( bool rotate );
%Docstring
Shall the marker be rotated.
%End
/**
* Returns the interval between individual markers. Units are specified through intervalUnits().
* @see setInterval()
* @see intervalUnit()
*/
double interval() const;
%Docstring
Returns the interval between individual markers. Units are specified through intervalUnits().
.. seealso:: setInterval()
.. seealso:: intervalUnit()
:rtype: float
%End
/**
* Sets the interval between individual markers.
* @param interval interval size. Units are specified through setIntervalUnits()
* @see interval()
* @see setIntervalUnits()
*/
void setInterval( double interval );
%Docstring
Sets the interval between individual markers.
\param interval interval size. Units are specified through setIntervalUnits()
.. seealso:: interval()
.. seealso:: setIntervalUnits()
%End
/**
* The placement of the markers.
*/
Placement placement() const;
%Docstring
The placement of the markers.
:rtype: Placement
%End
/**
* The placement of the markers.
*/
void setPlacement( Placement p );
%Docstring
The placement of the markers.
%End
/** Returns the offset along the line for the marker placement. For Interval placements, this is the distance
* between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the
* distance between the marker and the start of the line or the end of the line respectively.
* This setting has no effect for Vertex or CentralPoint placements.
* @returns The offset along the line. The unit for the offset is retrievable via offsetAlongLineUnit.
* @note added in 2.3
* @see setOffsetAlongLine
* @see offsetAlongLineUnit
* @see placement
*/
double offsetAlongLine() const;
%Docstring
Returns the offset along the line for the marker placement. For Interval placements, this is the distance
between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the
distance between the marker and the start of the line or the end of the line respectively.
This setting has no effect for Vertex or CentralPoint placements.
:return: The offset along the line. The unit for the offset is retrievable via offsetAlongLineUnit.
.. versionadded:: 2.3
.. seealso:: setOffsetAlongLine
.. seealso:: offsetAlongLineUnit
.. seealso:: placement
:rtype: float
%End
/** Sets the the offset along the line for the marker placement. For Interval placements, this is the distance
* between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the
* distance between the marker and the start of the line or the end of the line respectively.
* This setting has no effect for Vertex or CentralPoint placements.
* @param offsetAlongLine Distance to offset markers along the line. The offset
* unit is set via setOffsetAlongLineUnit.
* @note added in 2.3
* @see offsetAlongLine
* @see setOffsetAlongLineUnit
* @see setPlacement
*/
void setOffsetAlongLine( double offsetAlongLine );
%Docstring
Sets the the offset along the line for the marker placement. For Interval placements, this is the distance
between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the
distance between the marker and the start of the line or the end of the line respectively.
This setting has no effect for Vertex or CentralPoint placements.
\param offsetAlongLine Distance to offset markers along the line. The offset
unit is set via setOffsetAlongLineUnit.
.. versionadded:: 2.3
.. seealso:: offsetAlongLine
.. seealso:: setOffsetAlongLineUnit
.. seealso:: setPlacement
%End
/** Returns the unit used for calculating the offset along line for markers.
* @returns Offset along line unit type.
* @see setOffsetAlongLineUnit
* @see offsetAlongLine
*/
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const;
%Docstring
Returns the unit used for calculating the offset along line for markers.
:return: Offset along line unit type.
.. seealso:: setOffsetAlongLineUnit
.. seealso:: offsetAlongLine
:rtype: QgsUnitTypes.RenderUnit
%End
/** Sets the unit used for calculating the offset along line for markers.
* @param unit Offset along line unit type.
* @see offsetAlongLineUnit
* @see setOffsetAlongLine
*/
void setOffsetAlongLineUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the unit used for calculating the offset along line for markers.
\param unit Offset along line unit type.
.. seealso:: offsetAlongLineUnit
.. seealso:: setOffsetAlongLine
%End
/** Returns the map unit scale used for calculating the offset in map units along line for markers.
* @returns Offset along line map unit scale.
*/
const QgsMapUnitScale &offsetAlongLineMapUnitScale() const;
%Docstring
Returns the map unit scale used for calculating the offset in map units along line for markers.
:return: Offset along line map unit scale.
:rtype: QgsMapUnitScale
%End
/** Sets the map unit scale used for calculating the offset in map units along line for markers.
* @param scale Offset along line map unit scale.
*/
void setOffsetAlongLineMapUnitScale( const QgsMapUnitScale &scale );
%Docstring
Sets the map unit scale used for calculating the offset in map units along line for markers.
\param scale Offset along line map unit scale.
%End
/** Sets the units for the interval between markers.
* @param unit interval units
* @see intervalUnit()
* @see setInterval()
*/
void setIntervalUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the units for the interval between markers.
\param unit interval units
.. seealso:: intervalUnit()
.. seealso:: setInterval()
%End
/** Returns the units for the interval between markers.
* @see setIntervalUnit()
* @see interval()
*/
QgsUnitTypes::RenderUnit intervalUnit() const;
%Docstring
Returns the units for the interval between markers.
.. seealso:: setIntervalUnit()
.. seealso:: interval()
:rtype: QgsUnitTypes.RenderUnit
%End
void setIntervalMapUnitScale( const QgsMapUnitScale &scale );
const QgsMapUnitScale &intervalMapUnitScale() const;
%Docstring
:rtype: QgsMapUnitScale
%End
void setOutputUnit( QgsUnitTypes::RenderUnit unit );
QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
void setMapUnitScale( const QgsMapUnitScale &scale );
QgsMapUnitScale mapUnitScale() const;
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
virtual void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property );
QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property );
protected:
@ -283,8 +376,21 @@ class QgsMarkerLineSymbolLayer : QgsLineSymbolLayer
void renderPolylineVertex( const QPolygonF &points, QgsSymbolRenderContext &context, Placement placement = Vertex );
void renderPolylineCentral( const QPolygonF &points, QgsSymbolRenderContext &context );
double markerAngle( const QPolygonF &points, bool isRing, int vertex );
%Docstring
:rtype: float
%End
private:
QgsMarkerLineSymbolLayer( const QgsMarkerLineSymbolLayer &other );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgslinesymbollayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,34 @@
/**
When drawing a vector layer with rule-based renderer, it goes through
the rules and draws features with symbols from rules that match.
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgsrulebasedrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsRuleBasedRenderer : QgsFeatureRenderer
{
%Docstring
When drawing a vector layer with rule-based renderer, it goes through
the rules and draws features with symbols from rules that match.
%End
%TypeHeaderCode
#include <qgsrulebasedrenderer.h>
#include "qgsrulebasedrenderer.h"
%End
public:
// TODO: use QVarLengthArray instead of QList
enum FeatureFlags { FeatIsSelected, FeatDrawMarkers, };
enum FeatureFlags
{
FeatIsSelected,
FeatDrawMarkers
};
// feature for rendering: QgsFeature and some flags
struct FeatureToRender
{
FeatureToRender( QgsFeature &_f, int _flags );
@ -20,8 +36,6 @@ class QgsRuleBasedRenderer : QgsFeatureRenderer
int flags; // selected and/or draw markers
};
// rendering job: a feature to be rendered with a particular symbol
// (both f, symbol are _not_ owned by this class)
struct RenderJob
{
RenderJob( QgsRuleBasedRenderer::FeatureToRender &_ftr, QgsSymbol *_s );
@ -29,308 +43,407 @@ class QgsRuleBasedRenderer : QgsFeatureRenderer
QgsSymbol *symbol;
};
// render level: a list of jobs to be drawn at particular level
// (jobs are owned by this class)
struct RenderLevel
{
RenderLevel( int z );
explicit RenderLevel( int z );
~RenderLevel();
int zIndex;
QList<QgsRuleBasedRenderer::RenderJob*> jobs;
QList<QgsRuleBasedRenderer::RenderJob *> jobs;
RenderLevel( const QgsRuleBasedRenderer::RenderLevel &other );
};
// rendering queue: a list of rendering levels
typedef QList<QgsRuleBasedRenderer::RenderLevel> RenderQueue;
/**
This class keeps data about a rules for rule-based renderer.
A rule consists of a symbol, filter expression and range of scales.
If filter is empty, it matches all features.
If scale range has both values zero, it matches all scales.
If one of the min/max scale denominators is zero, there is no lower/upper bound for scales.
A rule matches if both filter and scale range match.
*/
typedef QList<QgsRuleBasedRenderer::Rule *> RuleList;
class Rule
{
{
%Docstring
This class keeps data about a rules for rule-based renderer.
A rule consists of a symbol, filter expression and range of scales.
If filter is empty, it matches all features.
If scale range has both values zero, it matches all scales.
If one of the min/max scale denominators is zero, there is no lower/upper bound for scales.
A rule matches if both filter and scale range match.
%End
%TypeHeaderCode
#include "qgsrulebasedrenderer.h"
%End
public:
//! The result of rendering a rule
enum RenderResult
{
Filtered = 0, //!< The rule does not apply
Inactive, //!< The rule is inactive
Rendered //!< Something was rendered
Filtered,
Inactive,
Rendered
};
//! Constructor takes ownership of the symbol
Rule( QgsSymbol* symbol /Transfer/, int scaleMinDenom = 0, int scaleMaxDenom = 0, const QString& filterExp = QString(),
Rule( QgsSymbol *symbol /Transfer/, int scaleMinDenom = 0, int scaleMaxDenom = 0, const QString &filterExp = QString(),
const QString &label = QString(), const QString &description = QString(), bool elseRule = false );
%Docstring
Constructor takes ownership of the symbol
%End
~Rule();
/**
* Dump for debug purpose
* @param indent How many characters to indent. Will increase by two with every of the recursive calls
* @return A string representing this rule
*/
QString dump( int indent = 0 ) const;
/**
* Return the attributes used to evaluate the expression of this rule
* @return A set of attribute names
*/
QString dump( int indent = 0 ) const;
%Docstring
Dump for debug purpose
\param indent How many characters to indent. Will increase by two with every of the recursive calls
:return: A string representing this rule
:rtype: str
%End
QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
%Docstring
Return the attributes used to evaluate the expression of this rule
:return: A set of attribute names
:rtype: set of str
%End
/**
* Returns true if this rule or one of its chilren needs the geometry to be applied.
*/
bool needsGeometry() const;
%Docstring
Returns true if this rule or one of its chilren needs the geometry to be applied.
:rtype: bool
%End
//! @note available in python bindings as symbol2
QgsSymbolList symbols( const QgsRenderContext &context = QgsRenderContext() );
QgsSymbolList symbols( const QgsRenderContext &context = QgsRenderContext() ) const;
%Docstring
.. note::
available in Python bindings as symbol2
:rtype: QgsSymbolList
%End
//! @note not available in python bindings
// QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString &rule = "" ) const;
//! @note added in 2.6
QgsLegendSymbolListV2 legendSymbolItemsV2( int currentLevel = -1 ) const;
%Docstring
.. versionadded:: 2.6
:rtype: QgsLegendSymbolListV2
%End
/**
* Check if a given feature shall be rendered by this rule
*
* @param f The feature to test
* @param context The context in which the rendering happens
* @return True if the feature shall be rendered
*/
bool isFilterOK( QgsFeature &f, QgsRenderContext *context = 0 ) const;
%Docstring
Check if a given feature shall be rendered by this rule
\param f The feature to test
\param context The context in which the rendering happens
:return: True if the feature shall be rendered
:rtype: bool
%End
/**
* Check if this rule applies for a given scale
* @param scale The scale to check. If set to 0, it will always return true.
*
* @return If the rule will be evaluated at this scale
*/
bool isScaleOK( double scale ) const;
%Docstring
Check if this rule applies for a given scale
\param scale The scale to check. If set to 0, it will always return true.
:return: If the rule will be evaluated at this scale
:rtype: bool
%End
QgsSymbol *symbol();
%Docstring
:rtype: QgsSymbol
%End
QString label() const;
%Docstring
:rtype: str
%End
bool dependsOnScale() const;
%Docstring
:rtype: bool
%End
int scaleMinDenom() const;
%Docstring
:rtype: int
%End
int scaleMaxDenom() const;
%Docstring
:rtype: int
%End
/**
* A filter that will check if this rule applies
* @return An expression
*/
QgsExpression *filter() const;
%Docstring
A filter that will check if this rule applies
:return: An expression
:rtype: QgsExpression
%End
/**
* A filter that will check if this rule applies
* @return An expression
*/
QString filterExpression() const;
%Docstring
A filter that will check if this rule applies
:return: An expression
:rtype: str
%End
/**
* A human readable description for this rule
*
* @return Description
*/
QString description() const;
%Docstring
A human readable description for this rule
:return: Description
:rtype: str
%End
/**
* Returns if this rule is active
*
* @return True if the rule is active
*/
bool active() const;
%Docstring
Returns if this rule is active
:return: True if the rule is active
:rtype: bool
%End
//! Unique rule identifier (for identification of rule within renderer)
//! @note added in 2.6
QString ruleKey() const;
//! Override the assigned rule key (should be used just internally by rule-based renderer)
//! @note added in 2.6
%Docstring
.. versionadded:: 2.6
:rtype: str
%End
void setRuleKey( const QString &key );
%Docstring
.. versionadded:: 2.6
%End
//! set a new symbol (or NULL). Deletes old symbol.
void setSymbol( QgsSymbol *sym /Transfer/ );
%Docstring
set a new symbol (or NULL). Deletes old symbol.
%End
void setLabel( const QString &label );
/**
* Set the minimum denominator for which this rule shall apply.
* E.g. 1000 if it shall be evaluated between 1:1000 and 1:100'000
* Set to 0 to disable the minimum check
* @param scaleMinDenom The minimum scale denominator for this rule
*/
void setScaleMinDenom( int scaleMinDenom );
%Docstring
Set the minimum denominator for which this rule shall apply.
E.g. 1000 if it shall be evaluated between 1:1000 and 1:100'000
Set to 0 to disable the minimum check
\param scaleMinDenom The minimum scale denominator for this rule
%End
/**
* Set the maximum denominator for which this rule shall apply.
* E.g. 100'000 if it shall be evaluated between 1:1000 and 1:100'000
* Set to 0 to disable the maximum check
* @param scaleMaxDenom maximum scale denominator for this rule
*/
void setScaleMaxDenom( int scaleMaxDenom );
%Docstring
Set the maximum denominator for which this rule shall apply.
E.g. 100'000 if it shall be evaluated between 1:1000 and 1:100'000
Set to 0 to disable the maximum check
\param scaleMaxDenom maximum scale denominator for this rule
%End
/**
* Set the expression used to check if a given feature shall be rendered with this rule
*
* @param filterExp An expression
*/
void setFilterExpression( const QString &filterExp );
%Docstring
Set the expression used to check if a given feature shall be rendered with this rule
\param filterExp An expression
%End
/**
* Set a human readable description for this rule
*
* @param description Description
*/
void setDescription( const QString &description );
%Docstring
Set a human readable description for this rule
\param description Description
%End
/**
* Sets if this rule is active
* @param state Determines if the rule should be activated or deactivated
*/
void setActive( bool state );
%Docstring
Sets if this rule is active
\param state Determines if the rule should be activated or deactivated
%End
//! clone this rule, return new instance
QgsRuleBasedRenderer::Rule *clone() const /Factory/;
%Docstring
clone this rule, return new instance
:rtype: QgsRuleBasedRenderer.Rule
%End
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props );
static QgsRuleBasedRenderer::Rule *createFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType ) /Factory/;
%Docstring
Create a rule from the SLD provided in element and for the specified geometry type.
:rtype: QgsRuleBasedRenderer.Rule
%End
QDomElement save( QDomDocument &doc, QgsSymbolMap &symbolMap );
QDomElement save( QDomDocument &doc, QgsSymbolMap &symbolMap ) const;
%Docstring
:rtype: QDomElement
%End
//! prepare the rule for rendering and its children (build active children array)
bool startRender( QgsRenderContext &context, const QgsFields &fields, QString &filter );
%Docstring
prepare the rule for rendering and its children (build active children array)
:rtype: bool
%End
//! get all used z-levels from this rule and children
QSet<int> collectZLevels();
%Docstring
get all used z-levels from this rule and children
:rtype: set of int
%End
//! assign normalized z-levels [0..N-1] for this rule's symbol for quick access during rendering
//! @note not available in python bindings
// void setNormZLevels( const QMap<int, int> &zLevelsToNormLevels );
/**
* Render a given feature, will recursively call subclasses and only render if the constraints apply.
*
* @param featToRender The feature to render
* @param context The rendering context
* @param renderQueue The rendering queue to which the feature should be added
* @return The result of the rendering. In explicit if the feature is added to the queue or
* the reason for not rendering the feature.
*/
QgsRuleBasedRenderer::Rule::RenderResult renderFeature( QgsRuleBasedRenderer::FeatureToRender &featToRender, QgsRenderContext &context, QgsRuleBasedRenderer::RenderQueue &renderQueue );
%Docstring
Render a given feature, will recursively call subclasses and only render if the constraints apply.
//! only tell whether a feature will be rendered without actually rendering it
bool willRenderFeature( QgsFeature &feat, QgsRenderContext *context = 0);
\param featToRender The feature to render
\param context The rendering context
\param renderQueue The rendering queue to which the feature should be added
:return: The result of the rendering. In explicit if the feature is added to the queue or
the reason for not rendering the feature.
:rtype: QgsRuleBasedRenderer.Rule.RenderResult
%End
bool willRenderFeature( QgsFeature &feat, QgsRenderContext *context = 0 );
%Docstring
only tell whether a feature will be rendered without actually rendering it
:rtype: bool
%End
//! tell which symbols will be used to render the feature
QgsSymbolList symbolsForFeature( QgsFeature &feat, QgsRenderContext *context = 0 );
%Docstring
tell which symbols will be used to render the feature
:rtype: QgsSymbolList
%End
/** Returns which legend keys match the feature
* @note added in QGIS 2.14
*/
QSet< QString > legendKeysForFeature( QgsFeature &feat, QgsRenderContext *context = 0 );
%Docstring
Returns which legend keys match the feature
.. versionadded:: 2.14
:rtype: set of str
%End
//! tell which rules will be used to render the feature
QList<QgsRuleBasedRenderer::Rule*> rulesForFeature( QgsFeature &feat, QgsRenderContext *context = 0 );
QgsRuleBasedRenderer::RuleList rulesForFeature( QgsFeature &feat, QgsRenderContext *context = 0 );
%Docstring
tell which rules will be used to render the feature
:rtype: QgsRuleBasedRenderer.RuleList
%End
/**
* Stop a rendering process. Used to clean up the internal state of this rule
*
* @param context The rendering context
*/
void stopRender( QgsRenderContext &context );
%Docstring
Stop a rendering process. Used to clean up the internal state of this rule
\param context The rendering context
%End
/**
* Create a rule from an XML definition
*
* @param ruleElem The XML rule element
* @param symbolMap Symbol map
*
* @return A new rule
*/
static QgsRuleBasedRenderer::Rule *create( QDomElement &ruleElem, QgsSymbolMap &symbolMap ) /Factory/;
%Docstring
Create a rule from an XML definition
/**
* Return all children rules of this rule
*
* @return A list of rules
*/
QList<QgsRuleBasedRenderer::Rule*> &children();
\param ruleElem The XML rule element
\param symbolMap Symbol map
/**
* Returns all children, grand-children, grand-grand-children, grand-gra... you get it
*
* @return A list of descendant rules
*/
QList<QgsRuleBasedRenderer::Rule*> descendants() const;
:return: A new rule
:rtype: QgsRuleBasedRenderer.Rule
%End
QgsRuleBasedRenderer::RuleList &children();
%Docstring
Return all children rules of this rule
:return: A list of rules
:rtype: QgsRuleBasedRenderer.RuleList
%End
QgsRuleBasedRenderer::RuleList descendants() const;
%Docstring
Returns all children, grand-children, grand-grand-children, grand-gra... you get it
:return: A list of descendant rules
:rtype: QgsRuleBasedRenderer.RuleList
%End
/**
* The parent rule
*
* @return Parent rule
*/
QgsRuleBasedRenderer::Rule *parent();
%Docstring
The parent rule
:return: Parent rule
:rtype: QgsRuleBasedRenderer.Rule
%End
//! add child rule, take ownership, sets this as parent
void appendChild( QgsRuleBasedRenderer::Rule *rule /Transfer/ );
%Docstring
add child rule, take ownership, sets this as parent
%End
//! add child rule, take ownership, sets this as parent
void insertChild( int i, QgsRuleBasedRenderer::Rule *rule /Transfer/ );
%Docstring
add child rule, take ownership, sets this as parent
%End
//! delete child rule
void removeChild( QgsRuleBasedRenderer::Rule *rule );
%Docstring
delete child rule
%End
//! delete child rule
void removeChildAt( int i );
%Docstring
delete child rule
%End
//! take child rule out, set parent as null
QgsRuleBasedRenderer::Rule *takeChild( QgsRuleBasedRenderer::Rule *rule ) /TransferBack/;
%Docstring
take child rule out, set parent as null
:rtype: QgsRuleBasedRenderer.Rule
%End
//! take child rule out, set parent as null
QgsRuleBasedRenderer::Rule *takeChildAt( int i ) /TransferBack/;
%Docstring
take child rule out, set parent as null
:rtype: QgsRuleBasedRenderer.Rule
%End
//! Try to find a rule given its unique key
//! @note added in 2.6
QgsRuleBasedRenderer::Rule *findRuleByKey( const QString &key );
%Docstring
.. versionadded:: 2.6
:rtype: QgsRuleBasedRenderer.Rule
%End
/**
* Sets if this rule is an ELSE rule
*
* @param iselse If true, this rule is an ELSE rule
*/
void setIsElse( bool iselse );
%Docstring
Sets if this rule is an ELSE rule
\param iselse If true, this rule is an ELSE rule
%End
/**
* Check if this rule is an ELSE rule
*
* @return True if this rule is an else rule
*/
bool isElse();
%Docstring
Check if this rule is an ELSE rule
:return: True if this rule is an else rule
:rtype: bool
%End
protected:
void initFilter();
private:
Rule( const QgsRuleBasedRenderer::Rule &rh );
};
/////
static QgsFeatureRenderer* create( QDomElement& element, const QgsReadWriteContext &context ) /Factory/;
static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Creates a new rule-based renderer instance from XML
:rtype: QgsFeatureRenderer
%End
//! Constructs the renderer from given tree of rules (takes ownership)
QgsRuleBasedRenderer( QgsRuleBasedRenderer::Rule *root /Transfer/ );
//! Constructor for convenience. Creates a root rule and adds a default rule with symbol (takes ownership)
%Docstring
Constructs the renderer from given tree of rules (takes ownership)
%End
QgsRuleBasedRenderer( QgsSymbol *defaultSymbol /Transfer/ );
%Docstring
Constructor for convenience. Creates a root rule and adds a default rule with symbol (takes ownership)
%End
~QgsRuleBasedRenderer();
//! return symbol for current feature. Should not be used individually: there could be more symbols for a feature
virtual QgsSymbol *symbolForFeature( QgsFeature &feature, QgsRenderContext &context );
%Docstring
return symbol for current feature. Should not be used individually: there could be more symbols for a feature
:rtype: QgsSymbol
%End
virtual bool renderFeature( QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
@ -346,82 +459,77 @@ class QgsRuleBasedRenderer : QgsFeatureRenderer
virtual QgsRuleBasedRenderer *clone() const /Factory/;
virtual void toSld( QDomDocument &doc, QDomElement &element ) const;
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props = QgsStringMap() ) const;
static QgsFeatureRenderer *createFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType ) /Factory/;
%Docstring
:rtype: QgsFeatureRenderer
%End
virtual QgsSymbolList symbols( QgsRenderContext &context );
//! store renderer info to XML element
virtual QDomElement save( QDomDocument& doc, const QgsReadWriteContext &context );
//! return a list of symbology items for the legend
virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context );
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
//! items of symbology items in legend should be checkable
//! @note added in 2.5
virtual bool legendSymbolItemsCheckable() const;
//! items of symbology items in legend is checked
//! @note added in 2.5
virtual bool legendSymbolItemChecked( const QString &key );
//! item in symbology was checked
//! @note added in 2.5
virtual void checkLegendSymbolItem( const QString &key, bool state = true );
virtual void setLegendSymbolItem( const QString &key, QgsSymbol *symbol /Transfer/ );
//! return a list of item text / symbol
//! @note not available in python bindings
// virtual QgsLegendSymbolList legendSymbolItems();
//! Return a list of symbology items for the legend. Better choice than legendSymbolItems().
//! Default fallback implementation just uses legendSymbolItems() implementation
//! @note added in 2.6
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const;
//! for debugging
virtual QString dump() const;
//! return whether the renderer will render a feature or not.
//! Must be called between startRender() and stopRender() calls.
virtual bool willRenderFeature( QgsFeature &feat, QgsRenderContext &context );
//! return list of symbols used for rendering the feature.
//! For renderers that do not support MoreSymbolsPerFeature it is more efficient
//! to use symbolForFeature()
virtual QgsSymbolList symbolsForFeature( QgsFeature &feat, QgsRenderContext &context );
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature &feat, QgsRenderContext &context );
virtual QSet<QString> legendKeysForFeature( QgsFeature &feature, QgsRenderContext &context );
//! returns bitwise OR-ed capabilities of the renderer
virtual QgsFeatureRenderer::Capabilities capabilities();
/////
QgsRuleBasedRenderer::Rule *rootRule();
%Docstring
:rtype: QgsRuleBasedRenderer.Rule
%End
//////
//! take a rule and create a list of new rules based on the categories from categorized symbol renderer
static void refineRuleCategories( QgsRuleBasedRenderer::Rule *initialRule, QgsCategorizedSymbolRenderer *r );
//! take a rule and create a list of new rules based on the ranges from graduated symbol renderer
%Docstring
take a rule and create a list of new rules based on the categories from categorized symbol renderer
%End
static void refineRuleRanges( QgsRuleBasedRenderer::Rule *initialRule, QgsGraduatedSymbolRenderer *r );
//! take a rule and create a list of new rules with intervals of scales given by the passed scale denominators
%Docstring
take a rule and create a list of new rules based on the ranges from graduated symbol renderer
%End
static void refineRuleScales( QgsRuleBasedRenderer::Rule *initialRule, QList<int> scales );
%Docstring
take a rule and create a list of new rules with intervals of scales given by the passed scale denominators
%End
//! creates a QgsRuleBasedRenderer from an existing renderer.
//! @note added in 2.5
//! @returns a new renderer if the conversion was possible, otherwise 0.
static QgsRuleBasedRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/;
%Docstring
:return: a new renderer if the conversion was possible, otherwise 0.
:rtype: QgsRuleBasedRenderer
%End
//! helper function to convert the size scale and rotation fields present in some other renderers to data defined symbology
static void convertToDataDefinedSymbology( QgsSymbol *symbol, const QString &sizeScaleField, const QString &rotationField = QString() );
%Docstring
helper function to convert the size scale and rotation fields present in some other renderers to data defined symbology
%End
protected:
private:
QgsRuleBasedRenderer( const QgsRuleBasedRenderer & );
QgsRuleBasedRenderer &operator=( const QgsRuleBasedRenderer & );
%Docstring
:rtype: QgsRuleBasedRenderer
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgsrulebasedrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -35,6 +35,9 @@ class QgsSingleSymbolRenderer : QgsFeatureRenderer
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props = QgsStringMap() ) const;
static QgsFeatureRenderer *createFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType );
%Docstring
:rtype: QgsFeatureRenderer
%End
virtual QgsFeatureRenderer::Capabilities capabilities();
virtual QgsSymbolList symbols( QgsRenderContext &context );

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,28 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgssymbollayerregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSymbolLayerWidget /External/;
class QgsSymbolLayerAbstractMetadata
{
%Docstring
Stores metadata about one symbol layer class.
.. note::
It's necessary to implement createSymbolLayer() function.
In C++ you can use QgsSymbolLayerMetadata convenience class.
%End
%TypeHeaderCode
#include <qgssymbollayerregistry.h>
#include "qgssymbollayerregistry.h"
%End
public:
QgsSymbolLayerAbstractMetadata( const QString &name, const QString &visibleName, QgsSymbol::SymbolType type );
@ -11,75 +30,143 @@ class QgsSymbolLayerAbstractMetadata
virtual ~QgsSymbolLayerAbstractMetadata();
QString name() const;
%Docstring
:rtype: str
%End
QString visibleName() const;
%Docstring
:rtype: str
%End
QgsSymbol::SymbolType type() const;
%Docstring
:rtype: QgsSymbol.SymbolType
%End
/** Create a symbol layer of this type given the map of properties. */
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) = 0 /Factory/;
/** Create widget for symbol layer of this type. Can return NULL if there's no GUI */
%Docstring
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
%End
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer * ) /Factory/;
/** Create a symbol layer of this type given the map of properties. */
virtual QgsSymbolLayer* createSymbolLayerFromSld( QDomElement & ) /Factory/;
virtual void resolvePaths( QgsStringMap& properties, const QgsPathResolver& pathResolver, bool saving );
%Docstring
Create widget for symbol layer of this type. Can return NULL if there's no GUI
:rtype: QgsSymbolLayerWidget
%End
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & );
%Docstring
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
%End
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
%Docstring
Resolve paths in symbol layer's properties (if there are any paths).
When saving is true, paths are converted from absolute to relative,
when saving is false, paths are converted from relative to absolute.
This ensures that paths in project files are absolute, but in symbol layer
instances the paths are always absolute
.. versionadded:: 3.0
%End
protected:
};
/**
Convenience metadata class that uses static functions to create symbol layer and its widget.
*/
class QgsSymbolLayerMetadata : QgsSymbolLayerAbstractMetadata
{
%TypeHeaderCode
#include <qgssymbollayerregistry.h>
%Docstring
Convenience metadata class that uses static functions to create symbol layer and its widget.
%End
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
public:
virtual QgsSymbolLayer* createSymbolLayer( const QgsStringMap& map ) /Factory/;
virtual QgsSymbolLayerWidget* createSymbolLayerWidget( const QgsVectorLayer* vl ) /Factory/;
virtual QgsSymbolLayer* createSymbolLayerFromSld( QDomElement& elem ) /Factory/;
virtual void resolvePaths( QgsStringMap& properties, const QgsPathResolver& pathResolver, bool saving );
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map );
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl );
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem );
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
protected:
private:
QgsSymbolLayerMetadata(); // pretend this is private
QgsSymbolLayerMetadata();
};
/**
Registry of available symbol layer classes.
Implemented as a singleton.
*/
class QgsSymbolLayerRegistry
{
%TypeHeaderCode
#include <qgssymbollayerregistry.h>
%Docstring
Registry of available symbol layer classes.
QgsSymbolLayerRegistry is not usually directly created, but rather accessed through
QgsApplication.symbolLayerRegistry().
%End
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
public:
QgsSymbolLayerRegistry();
~QgsSymbolLayerRegistry();
//! return metadata for specified symbol layer. Returns NULL if not found
QgsSymbolLayerAbstractMetadata *symbolLayerMetadata( const QString &name ) const;
%Docstring
return metadata for specified symbol layer. Returns NULL if not found
:rtype: QgsSymbolLayerAbstractMetadata
%End
//! register a new symbol layer type. Takes ownership of the metadata instance.
bool addSymbolLayerType( QgsSymbolLayerAbstractMetadata *metadata /Transfer/ );
%Docstring
register a new symbol layer type. Takes ownership of the metadata instance.
:rtype: bool
%End
//! create a new instance of symbol layer given symbol layer name and properties
QgsSymbolLayer *createSymbolLayer( const QString &name, const QgsStringMap &properties = QgsStringMap() ) const /Factory/;
%Docstring
create a new instance of symbol layer given symbol layer name and properties
:rtype: QgsSymbolLayer
%End
//! create a new instance of symbol layer given symbol layer name and SLD
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const;
%Docstring
create a new instance of symbol layer given symbol layer name and SLD
:rtype: QgsSymbolLayer
%End
void resolvePaths( const QString &name, QgsStringMap& properties, const QgsPathResolver& pathResolver, bool saving ) const;
void resolvePaths( const QString &name, QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving ) const;
%Docstring
Resolve paths in properties of a particular symbol layer.
This normally means converting relative paths to absolute paths when loading
and converting absolute paths to relative paths when saving.
.. versionadded:: 3.0
%End
//! return a list of available symbol layers for a specified symbol type
QStringList symbolLayersForType( QgsSymbol::SymbolType type );
%Docstring
return a list of available symbol layers for a specified symbol type
:rtype: list of str
%End
//! create a new instance of symbol layer for specified symbol type with default settings
static QgsSymbolLayer *defaultSymbolLayer( QgsSymbol::SymbolType type ) /Factory/;
%Docstring
create a new instance of symbol layer for specified symbol type with default settings
:rtype: QgsSymbolLayer
%End
private:
QgsSymbolLayerRegistry( const QgsSymbolLayerRegistry &rh );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgssymbollayerregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -69,7 +69,7 @@ class CORE_EXPORT QgsGeometryGeneratorSymbolLayer : public QgsSymbolLayer
virtual QgsSymbol *subSymbol() override { return mSymbol; }
virtual bool setSubSymbol( QgsSymbol *symbol ) override;
virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;

View File

@ -209,7 +209,7 @@ class CORE_EXPORT QgsMarkerLineSymbolLayer : public QgsLineSymbolLayer
virtual QColor color() const override;
QgsSymbol *subSymbol() override;
bool setSubSymbol( QgsSymbol *symbol ) override;
bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
virtual void setWidth( double width ) override;
virtual double width() const override;
@ -328,7 +328,7 @@ class CORE_EXPORT QgsMarkerLineSymbolLayer : public QgsLineSymbolLayer
QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
void setDataDefinedProperty( Property key, const QgsProperty &property ) override;
void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
protected:

View File

@ -128,11 +128,11 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerBase : public QgsMarkerSymbolLayer
//! Prepares the layer for drawing the specified shape (QPolygonF version)
//! \note not available in Python bindings
bool prepareMarkerShape( Shape shape ) SIP_SKIP;
bool prepareMarkerShape( Shape shape );
//! Prepares the layer for drawing the specified shape (QPainterPath version)
//! \note not available in Python bindings
bool prepareMarkerPath( Shape symbol ) SIP_SKIP;
bool prepareMarkerPath( Shape symbol );
/** Creates a polygon representing the specified shape.
* \param shape shape to create
@ -140,7 +140,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerBase : public QgsMarkerSymbolLayer
* \returns true if shape was successfully stored in polygon
* \note not available in Python bindings
*/
bool shapeToPolygon( Shape shape, QPolygonF &polygon ) const SIP_SKIP;
bool shapeToPolygon( Shape shape, QPolygonF &polygon ) const;
/** Calculates the desired size of the marker, considering data defined size overrides.
* \param context symbol render context
@ -148,7 +148,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerBase : public QgsMarkerSymbolLayer
* \returns marker size, in original size units
* \note not available in Python bindings
*/
double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const SIP_SKIP;
double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
/** Calculates the marker offset and rotation.
* \param context symbol render context
@ -158,7 +158,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerBase : public QgsMarkerSymbolLayer
* \param angle will be set to calculated marker angle
* \note not available in Python bindings
*/
void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const SIP_SKIP;
void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const;
//! Polygon of points in shape. If polygon is empty then shape is using mPath.
QPolygonF mPolygon;
@ -178,7 +178,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerBase : public QgsMarkerSymbolLayer
* in the path argument.
* \param path transformed painter path representing shape to draw
*/
virtual void draw( QgsSymbolRenderContext &context, Shape shape, const QPolygonF &polygon, const QPainterPath &path ) = 0 SIP_FORCE;
virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) = 0 SIP_FORCE;
};
/** \ingroup core
@ -383,7 +383,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayer : public QgsSimpleMarkerSymbolLayer
private:
virtual void draw( QgsSymbolRenderContext &context, Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
};
/** \ingroup core
@ -430,7 +430,7 @@ class CORE_EXPORT QgsFilledMarkerSymbolLayer : public QgsSimpleMarkerSymbolLayer
QgsFilledMarkerSymbolLayer( const QgsFilledMarkerSymbolLayer & );
#endif
virtual void draw( QgsSymbolRenderContext &context, Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
//! Fill subsymbol
std::unique_ptr< QgsFillSymbol > mFill;

View File

@ -125,7 +125,7 @@ class CORE_EXPORT QgsRuleBasedRenderer : public QgsFeatureRenderer
};
//! Constructor takes ownership of the symbol
Rule( QgsSymbol *symbol, int scaleMinDenom = 0, int scaleMaxDenom = 0, const QString &filterExp = QString(),
Rule( QgsSymbol *symbol SIP_TRANSFER, int scaleMinDenom = 0, int scaleMaxDenom = 0, const QString &filterExp = QString(),
const QString &label = QString(), const QString &description = QString(), bool elseRule = false );
~Rule();