QGIS API Documentation
3.6.0-Noosa (5873452)
|
#include <qgslinesymbollayer.h>
Public Member Functions | |
QgsMarkerLineSymbolLayer (bool rotateMarker=DEFAULT_MARKERLINE_ROTATE, double interval=DEFAULT_MARKERLINE_INTERVAL) | |
QgsMarkerLineSymbolLayer * | clone () const override |
Shall be reimplemented by subclasses to create a deep copy of the instance. More... | |
QColor | color () const override |
The fill color. More... | |
double | estimateMaxBleed (const QgsRenderContext &context) const override |
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context. More... | |
bool | hasDataDefinedProperties () const override |
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties. More... | |
double | interval () const |
Returns the interval between individual markers. More... | |
const QgsMapUnitScale & | intervalMapUnitScale () const |
QgsUnitTypes::RenderUnit | intervalUnit () const |
Returns the units for the interval between markers. More... | |
QString | layerType () const override |
Returns a string that represents this layer type. More... | |
QgsMapUnitScale | mapUnitScale () const override |
double | offsetAlongLine () const |
Returns the offset along the line for the marker placement. More... | |
const QgsMapUnitScale & | offsetAlongLineMapUnitScale () const |
Returns the map unit scale used for calculating the offset in map units along line for markers. More... | |
QgsUnitTypes::RenderUnit | offsetAlongLineUnit () const |
Returns the unit used for calculating the offset along line for markers. More... | |
QgsUnitTypes::RenderUnit | outputUnit () const override |
Returns the units to use for sizes and widths within the symbol layer. More... | |
Placement | placement () const |
The placement of the markers. More... | |
QgsStringMap | properties () const override |
Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer. More... | |
void | renderPolygonStroke (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolRenderContext &context) override |
void | renderPolyline (const QPolygonF &points, QgsSymbolRenderContext &context) override |
bool | rotateMarker () const |
Shall the marker be rotated. More... | |
void | setColor (const QColor &color) override |
The fill color. More... | |
void | setDataDefinedProperty (QgsSymbolLayer::Property key, const QgsProperty &property) override |
Sets a data defined property for the layer. More... | |
void | setInterval (double interval) |
Sets the interval between individual markers. More... | |
void | setIntervalMapUnitScale (const QgsMapUnitScale &scale) |
void | setIntervalUnit (QgsUnitTypes::RenderUnit unit) |
Sets the units for the interval between markers. More... | |
void | setMapUnitScale (const QgsMapUnitScale &scale) override |
void | setOffsetAlongLine (double offsetAlongLine) |
Sets the the offset along the line for the marker placement. More... | |
void | setOffsetAlongLineMapUnitScale (const QgsMapUnitScale &scale) |
Sets the map unit scale used for calculating the offset in map units along line for markers. More... | |
void | setOffsetAlongLineUnit (QgsUnitTypes::RenderUnit unit) |
Sets the unit used for calculating the offset along line for markers. More... | |
void | setOutputUnit (QgsUnitTypes::RenderUnit unit) override |
Sets the units to use for sizes and widths within the symbol layer. More... | |
void | setPlacement (Placement p) |
The placement of the markers. More... | |
void | setRotateMarker (bool rotate) |
Shall the marker be rotated. More... | |
bool | setSubSymbol (QgsSymbol *symbol) override |
Sets layer's subsymbol. takes ownership of the passed symbol. More... | |
void | setWidth (double width) override |
void | startRender (QgsSymbolRenderContext &context) override |
void | stopRender (QgsSymbolRenderContext &context) override |
QgsSymbol * | subSymbol () override |
Returns the symbol's sub symbol, if present. More... | |
void | toSld (QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override |
QSet< QString > | usedAttributes (const QgsRenderContext &context) const override |
Returns the set of attributes referenced by the layer. More... | |
double | width () const override |
Returns the estimated width for the line symbol layer. More... | |
double | width (const QgsRenderContext &context) const override |
Returns the line symbol layer width, in painter units. More... | |
Public Member Functions inherited from QgsLineSymbolLayer | |
void | drawPreviewIcon (QgsSymbolRenderContext &context, QSize size) override |
double | dxfWidth (const QgsDxfExport &e, QgsSymbolRenderContext &context) const override |
Gets line width. More... | |
QgsMapUnitScale | mapUnitScale () const override |
double | offset () const |
const QgsMapUnitScale & | offsetMapUnitScale () const |
QgsUnitTypes::RenderUnit | offsetUnit () const |
Returns the units for the line's offset. More... | |
QgsUnitTypes::RenderUnit | outputUnit () const override |
Returns the units to use for sizes and widths within the symbol layer. More... | |
RenderRingFilter | ringFilter () const |
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line symbol is being used to draw a polygon's rings. More... | |
void | setMapUnitScale (const QgsMapUnitScale &scale) override |
void | setOffset (double offset) |
void | setOffsetMapUnitScale (const QgsMapUnitScale &scale) |
void | setOffsetUnit (QgsUnitTypes::RenderUnit unit) |
Sets the units for the line's offset. More... | |
void | setOutputUnit (QgsUnitTypes::RenderUnit unit) override |
Sets the units to use for sizes and widths within the symbol layer. More... | |
void | setRingFilter (QgsLineSymbolLayer::RenderRingFilter filter) |
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbol is being used to draw a polygon's rings. More... | |
void | setWidthMapUnitScale (const QgsMapUnitScale &scale) |
void | setWidthUnit (QgsUnitTypes::RenderUnit unit) |
Sets the units for the line's width. More... | |
const QgsMapUnitScale & | widthMapUnitScale () const |
QgsUnitTypes::RenderUnit | widthUnit () const |
Returns the units for the line's width. More... | |
Public Member Functions inherited from QgsSymbolLayer | |
virtual | ~QgsSymbolLayer () |
QgsPropertyCollection & | dataDefinedProperties () |
Returns a reference to the symbol layer's property collection, used for data defined overrides. More... | |
const QgsPropertyCollection & | dataDefinedProperties () const |
Returns a reference to the symbol layer's property collection, used for data defined overrides. More... | |
virtual double | dxfAngle (QgsSymbolRenderContext &context) const |
Gets angle. More... | |
virtual QColor | dxfBrushColor (QgsSymbolRenderContext &context) const |
Gets brush/fill color. More... | |
virtual Qt::BrushStyle | dxfBrushStyle () const |
Gets brush/fill style. More... | |
virtual QColor | dxfColor (QgsSymbolRenderContext &context) const |
Gets color. More... | |
virtual QVector< qreal > | dxfCustomDashPattern (QgsUnitTypes::RenderUnit &unit) const |
Gets dash pattern. More... | |
virtual double | dxfOffset (const QgsDxfExport &e, QgsSymbolRenderContext &context) const |
Gets offset. More... | |
virtual Qt::PenStyle | dxfPenStyle () const |
Gets pen style. More... | |
bool | enabled () const |
Returns true if symbol layer is enabled and will be drawn. More... | |
virtual QColor | fillColor () const |
Gets fill color. More... | |
virtual bool | isCompatibleWithSymbol (QgsSymbol *symbol) const |
Returns if the layer can be used below the specified symbol. More... | |
bool | isLocked () const |
virtual QString | ogrFeatureStyle (double mmScaleFactor, double mapUnitScaleFactor) const |
QgsPaintEffect * | paintEffect () const |
Returns the current paint effect for the layer. More... | |
virtual void | prepareExpressions (const QgsSymbolRenderContext &context) |
Prepares all data defined property expressions for evaluation. More... | |
int | renderingPass () const |
void | setDataDefinedProperties (const QgsPropertyCollection &collection) |
Sets the symbol layer's property collection, used for data defined overrides. More... | |
void | setEnabled (bool enabled) |
Sets whether symbol layer is enabled and should be drawn. More... | |
virtual void | setFillColor (const QColor &color) |
Set fill color. More... | |
void | setLocked (bool locked) |
void | setPaintEffect (QgsPaintEffect *effect) |
Sets the current paint effect for the layer. More... | |
void | setRenderingPass (int renderingPass) |
virtual void | setStrokeColor (const QColor &color) |
Set stroke color. More... | |
virtual QColor | strokeColor () const |
Gets stroke color. More... | |
QgsSymbol::SymbolType | type () const |
virtual bool | writeDxf (QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const |
write as DXF More... | |
Static Public Member Functions | |
static QgsSymbolLayer * | create (const QgsStringMap &properties=QgsStringMap()) |
Create a new MarkerLineSymbolLayerV2. More... | |
static QgsSymbolLayer * | createFromSld (QDomElement &element) |
Create a new MarkerLineSymbolLayerV2 from SLD. More... | |
Static Public Member Functions inherited from QgsSymbolLayer | |
static const QgsPropertiesDefinition & | propertyDefinitions () |
Returns the symbol layer property definitions. More... | |
Protected Member Functions | |
double | markerAngle (const QPolygonF &points, bool isRing, int vertex) |
void | renderPolylineCentral (const QPolygonF &points, QgsSymbolRenderContext &context) |
void | renderPolylineInterval (const QPolygonF &points, QgsSymbolRenderContext &context) |
void | renderPolylineVertex (const QPolygonF &points, QgsSymbolRenderContext &context, Placement placement=Vertex) |
Protected Member Functions inherited from QgsLineSymbolLayer | |
QgsLineSymbolLayer (bool locked=false) | |
Protected Member Functions inherited from QgsSymbolLayer | |
QgsSymbolLayer (QgsSymbol::SymbolType type, bool locked=false) | |
void | copyDataDefinedProperties (QgsSymbolLayer *destLayer) const |
Copies all data defined properties of this layer to another symbol layer. More... | |
void | copyPaintEffect (QgsSymbolLayer *destLayer) const |
Copies paint effect of this layer to another symbol layer. More... | |
void | restoreOldDataDefinedProperties (const QgsStringMap &stringMap) |
Restores older data defined properties from string map. More... | |
Protected Attributes | |
double | mInterval |
QgsMapUnitScale | mIntervalMapUnitScale |
QgsUnitTypes::RenderUnit | mIntervalUnit |
std::unique_ptr< QgsMarkerSymbol > | mMarker |
double | mOffsetAlongLine |
QgsMapUnitScale | mOffsetAlongLineMapUnitScale |
QgsUnitTypes::RenderUnit | mOffsetAlongLineUnit |
Placement | mPlacement |
bool | mRotateMarker |
Protected Attributes inherited from QgsLineSymbolLayer | |
double | mOffset = 0 |
QgsMapUnitScale | mOffsetMapUnitScale |
QgsUnitTypes::RenderUnit | mOffsetUnit = QgsUnitTypes::RenderMillimeters |
RenderRingFilter | mRingFilter = AllRings |
double | mWidth = 0 |
QgsMapUnitScale | mWidthMapUnitScale |
QgsUnitTypes::RenderUnit | mWidthUnit = QgsUnitTypes::RenderMillimeters |
Protected Attributes inherited from QgsSymbolLayer | |
QColor | mColor |
QgsPropertyCollection | mDataDefinedProperties |
bool | mEnabled |
True if layer is enabled and should be drawn. More... | |
QgsFields | mFields |
bool | mLocked |
QgsPaintEffect * | mPaintEffect = nullptr |
int | mRenderingPass |
QgsSymbol::SymbolType | mType |
Additional Inherited Members | |
Static Protected Attributes inherited from QgsSymbolLayer | |
static const bool | SELECT_FILL_BORDER = false |
Whether fill styles for selected features also highlight symbol stroke. More... | |
static const bool | SELECT_FILL_STYLE = false |
Whether fill styles for selected features uses symbol layer style. More... | |
static const bool | SELECTION_IS_OPAQUE = true |
Whether styles for selected features ignore symbol alpha. More... | |
Definition at line 172 of file qgslinesymbollayer.h.
Defines how/where the marker should be placed on the line.
Enumerator | |
---|---|
Interval | |
Vertex | |
LastVertex | |
FirstVertex | |
CentralPoint | |
CurvePoint |
Definition at line 181 of file qgslinesymbollayer.h.
QgsMarkerLineSymbolLayer::QgsMarkerLineSymbolLayer | ( | bool | rotateMarker = DEFAULT_MARKERLINE_ROTATE , |
double | interval = DEFAULT_MARKERLINE_INTERVAL |
||
) |
Definition at line 740 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Shall be reimplemented by subclasses to create a deep copy of the instance.
Implements QgsSymbolLayer.
Definition at line 1429 of file qgslinesymbollayer.cpp.
|
overridevirtual |
The fill color.
Reimplemented from QgsSymbolLayer.
Definition at line 836 of file qgslinesymbollayer.cpp.
|
static |
Create a new MarkerLineSymbolLayerV2.
properties | A property map to deserialize saved information from properties() |
Definition at line 753 of file qgslinesymbollayer.cpp.
|
static |
Create a new MarkerLineSymbolLayerV2 from SLD.
element | An SLD XML DOM element |
Definition at line 1525 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context.
For example, polygons drawn with an stroke will draw half the width of the stroke outside of the polygon. This amount is estimated, since it may be affected by data defined symbology rules.
Reimplemented from QgsSymbolLayer.
Definition at line 1682 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
Reimplemented from QgsSymbolLayer.
Definition at line 1673 of file qgslinesymbollayer.cpp.
|
inline |
Returns the interval between individual markers.
Units are specified through intervalUnits().
Definition at line 260 of file qgslinesymbollayer.h.
|
inline |
Definition at line 351 of file qgslinesymbollayer.h.
|
inline |
Returns the units for the interval between markers.
Definition at line 348 of file qgslinesymbollayer.h.
|
overridevirtual |
Returns a string that represents this layer type.
Used for serialization. Should match with the string used to register this symbol layer in the registry.
Implements QgsSymbolLayer.
Definition at line 825 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsSymbolLayer.
Definition at line 1654 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 1199 of file qgslinesymbollayer.cpp.
|
inline |
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.
Definition at line 291 of file qgslinesymbollayer.h.
|
inline |
Returns the map unit scale used for calculating the offset in map units along line for markers.
Definition at line 327 of file qgslinesymbollayer.h.
|
inline |
Returns the unit used for calculating the offset along line for markers.
Definition at line 313 of file qgslinesymbollayer.h.
|
overridevirtual |
Returns the units to use for sizes and widths within the symbol layer.
Individual symbol layer subclasses will interpret this in different ways, e.g., a marker symbol layer may use it to specify the units for the marker size, while a line symbol layer may use it to specify the units for the line width.
Reimplemented from QgsSymbolLayer.
Definition at line 1636 of file qgslinesymbollayer.cpp.
|
inline |
The placement of the markers.
Definition at line 273 of file qgslinesymbollayer.h.
|
overridevirtual |
Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer.
This is used to serialize a symbol layer perstistently.
Implements QgsSymbolLayer.
Definition at line 1381 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsLineSymbolLayer.
Definition at line 941 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Implements QgsLineSymbolLayer.
Definition at line 859 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 1332 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 985 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 1070 of file qgslinesymbollayer.cpp.
|
inline |
Shall the marker be rotated.
Definition at line 248 of file qgslinesymbollayer.h.
|
overridevirtual |
The fill color.
Reimplemented from QgsSymbolLayer.
Definition at line 830 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Sets a data defined property for the layer.
Any existing property with the same key will be overwritten.
Reimplemented from QgsSymbolLayer.
Definition at line 1608 of file qgslinesymbollayer.cpp.
|
inline |
Sets the interval between individual markers.
interval | interval size. Units are specified through setIntervalUnit() |
Definition at line 268 of file qgslinesymbollayer.h.
|
inline |
Definition at line 350 of file qgslinesymbollayer.h.
|
inline |
Sets the units for the interval between markers.
unit | interval units |
Definition at line 341 of file qgslinesymbollayer.h.
|
overridevirtual |
Reimplemented from QgsSymbolLayer.
Definition at line 1646 of file qgslinesymbollayer.cpp.
|
inline |
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.
offsetAlongLine | Distance to offset markers along the line. The offset unit is set via setOffsetAlongLineUnit. |
Definition at line 305 of file qgslinesymbollayer.h.
|
inline |
Sets the map unit scale used for calculating the offset in map units along line for markers.
scale | Offset along line map unit scale. |
Definition at line 333 of file qgslinesymbollayer.h.
|
inline |
Sets the unit used for calculating the offset along line for markers.
unit | Offset along line unit type. |
Definition at line 321 of file qgslinesymbollayer.h.
|
overridevirtual |
Sets the units to use for sizes and widths within the symbol layer.
Individual symbol layer subclasses will interpret this in different ways, e.g., a marker symbol layer may use it to specify the units for the marker size, while a line symbol layer may use it to specify the units for the line width.
unit | output units |
Reimplemented from QgsSymbolLayer.
Definition at line 1627 of file qgslinesymbollayer.cpp.
|
inline |
The placement of the markers.
Definition at line 278 of file qgslinesymbollayer.h.
|
inline |
Shall the marker be rotated.
Definition at line 253 of file qgslinesymbollayer.h.
|
overridevirtual |
Sets layer's subsymbol. takes ownership of the passed symbol.
Reimplemented from QgsSymbolLayer.
Definition at line 1416 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsLineSymbolLayer.
Definition at line 1603 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Implements QgsSymbolLayer.
Definition at line 841 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Implements QgsSymbolLayer.
Definition at line 854 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns the symbol's sub symbol, if present.
Reimplemented from QgsSymbolLayer.
Definition at line 1411 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsSymbolLayer.
Definition at line 1448 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns the set of attributes referenced by the layer.
This includes attributes required by any data defined properties associated with the layer.
Reimplemented from QgsSymbolLayer.
Definition at line 1665 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns the estimated width for the line symbol layer.
Reimplemented from QgsLineSymbolLayer.
Definition at line 1617 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns the line symbol layer width, in painter units.
This method returns an accurate width by calculating the actual rendered width of the symbol layer using the provided render context.
Reimplemented from QgsLineSymbolLayer.
Definition at line 1622 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 373 of file qgslinesymbollayer.h.
|
protected |
Definition at line 375 of file qgslinesymbollayer.h.
|
protected |
Definition at line 374 of file qgslinesymbollayer.h.
|
protected |
Definition at line 376 of file qgslinesymbollayer.h.
|
protected |
Definition at line 378 of file qgslinesymbollayer.h.
|
protected |
Definition at line 380 of file qgslinesymbollayer.h.
|
protected |
Definition at line 379 of file qgslinesymbollayer.h.
|
protected |
Definition at line 377 of file qgslinesymbollayer.h.
|
protected |
Definition at line 372 of file qgslinesymbollayer.h.