QGIS API Documentation
3.2.0-Bonn (bc43194)
|
#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... | |
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 |
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... | |
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 | 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 |
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 155 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 164 of file qgslinesymbollayer.h.
QgsMarkerLineSymbolLayer::QgsMarkerLineSymbolLayer | ( | bool | rotateMarker = DEFAULT_MARKERLINE_ROTATE , |
double | interval = DEFAULT_MARKERLINE_INTERVAL |
||
) |
Definition at line 709 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Shall be reimplemented by subclasses to create a deep copy of the instance.
Implements QgsSymbolLayer.
Definition at line 1370 of file qgslinesymbollayer.cpp.
|
overridevirtual |
The fill color.
Reimplemented from QgsSymbolLayer.
Definition at line 800 of file qgslinesymbollayer.cpp.
|
static |
Create a new MarkerLineSymbolLayerV2.
properties | A property map to deserialize saved information from properties() |
Definition at line 722 of file qgslinesymbollayer.cpp.
|
static |
Create a new MarkerLineSymbolLayerV2 from SLD.
element | An SLD XML DOM element |
Definition at line 1465 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 1608 of file qgslinesymbollayer.cpp.
|
inline |
Returns the interval between individual markers.
Units are specified through intervalUnits().
Definition at line 242 of file qgslinesymbollayer.h.
|
inline |
Definition at line 333 of file qgslinesymbollayer.h.
|
inline |
Returns the units for the interval between markers.
Definition at line 330 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 789 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsSymbolLayer.
Definition at line 1589 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 1142 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 273 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 309 of file qgslinesymbollayer.h.
|
inline |
Returns the unit used for calculating the offset along line for markers.
Definition at line 295 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 1571 of file qgslinesymbollayer.cpp.
|
inline |
The placement of the markers.
Definition at line 255 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 1324 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsLineSymbolLayer.
Definition at line 905 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Implements QgsLineSymbolLayer.
Definition at line 823 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 1275 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 929 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 1014 of file qgslinesymbollayer.cpp.
|
inline |
Shall the marker be rotated.
Definition at line 230 of file qgslinesymbollayer.h.
|
overridevirtual |
The fill color.
Reimplemented from QgsSymbolLayer.
Definition at line 794 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 1548 of file qgslinesymbollayer.cpp.
|
inline |
Sets the interval between individual markers.
interval | interval size. Units are specified through setIntervalUnit() |
Definition at line 250 of file qgslinesymbollayer.h.
|
inline |
Definition at line 332 of file qgslinesymbollayer.h.
|
inline |
Sets the units for the interval between markers.
unit | interval units |
Definition at line 323 of file qgslinesymbollayer.h.
|
overridevirtual |
Reimplemented from QgsSymbolLayer.
Definition at line 1581 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 287 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 315 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 303 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 1562 of file qgslinesymbollayer.cpp.
|
inline |
The placement of the markers.
Definition at line 260 of file qgslinesymbollayer.h.
|
inline |
Shall the marker be rotated.
Definition at line 235 of file qgslinesymbollayer.h.
|
overridevirtual |
Sets layer's subsymbol. takes ownership of the passed symbol.
Reimplemented from QgsSymbolLayer.
Definition at line 1357 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsLineSymbolLayer.
Definition at line 1543 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Implements QgsSymbolLayer.
Definition at line 805 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Implements QgsSymbolLayer.
Definition at line 818 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Returns the symbol's sub symbol, if present.
Reimplemented from QgsSymbolLayer.
Definition at line 1352 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsSymbolLayer.
Definition at line 1388 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 1600 of file qgslinesymbollayer.cpp.
|
overridevirtual |
Reimplemented from QgsLineSymbolLayer.
Definition at line 1557 of file qgslinesymbollayer.cpp.
|
protected |
Definition at line 354 of file qgslinesymbollayer.h.
|
protected |
Definition at line 356 of file qgslinesymbollayer.h.
|
protected |
Definition at line 355 of file qgslinesymbollayer.h.
|
protected |
Definition at line 357 of file qgslinesymbollayer.h.
|
protected |
Definition at line 359 of file qgslinesymbollayer.h.
|
protected |
Definition at line 361 of file qgslinesymbollayer.h.
|
protected |
Definition at line 360 of file qgslinesymbollayer.h.
|
protected |
Definition at line 358 of file qgslinesymbollayer.h.
|
protected |
Definition at line 353 of file qgslinesymbollayer.h.