44 #include <QSvgGenerator> 89 , mClipFeaturesToExtent( true )
91 , mSymbolRenderContext( nullptr )
101 else if ( !
mLayers.
at( i )->isCompatibleWithSymbol(
this ) )
112 wkbPtr >> pt.
rx() >> pt.
ry();
129 unsigned int nPoints;
136 if ( clipToExtent && nPoints > 1 )
139 double cw = e.
width() / 10;
140 double ch = e.
height() / 10;
142 wkbPtr -= 1 + 2 *
sizeof( int );
148 Q_ASSERT( skipZM >= 0 );
150 if ( static_cast<int>( nPoints * ( 2 *
sizeof(
double ) + skipZM ) ) > wkbPtr.
remaining() )
152 QgsDebugMsg(
QString(
"%1 points exceed wkb length (%2>%3)" ).arg( nPoints ).arg( nPoints * ( 2 *
sizeof(
double ) + skipZM ) ).arg( wkbPtr.
remaining() ) );
159 for (
unsigned int i = 0; i < nPoints; ++i, ++ptr )
161 wkbPtr >> ptr->
rx() >> ptr->
ry();
173 for (
int i = 0; i < pts.
size(); ++i, ++ptr )
184 unsigned int numRings;
195 double cw = e.
width() / 10;
196 double ch = e.
height() / 10;
200 Q_ASSERT( skipZM >= 0 );
202 for (
unsigned int idx = 0; idx < numRings; idx++ )
204 unsigned int nPoints;
207 if ( static_cast<int>( nPoints * ( 2 *
sizeof(
double ) + skipZM ) ) > wkbPtr.
remaining() )
209 QgsDebugMsg(
QString(
"%1 points exceed wkb length (%2>%3)" ).arg( nPoints ).arg( nPoints * ( 2 *
sizeof(
double ) + skipZM ) ).arg( wkbPtr.
remaining() ) );
217 for (
unsigned int jdx = 0; jdx < nPoints; ++jdx, ++ptr )
219 wkbPtr >> ptr->
rx() >> ptr->
ry();
240 for (
int i = 0; i < poly.
size(); ++i, ++ptr )
256 delete mSymbolRenderContext;
274 if (( *it )->outputUnit() != unit )
298 if (( *it )->mapUnitScale() != scale )
343 if ( defaultSymbol !=
"" )
370 if ( defaultSymbol ==
"" ||
391 return mType == layerType;
442 if ( oldLayer == layer )
456 delete mSymbolRenderContext;
472 if ( mSymbolRenderContext )
478 delete mSymbolRenderContext;
479 mSymbolRenderContext =
nullptr;
498 if ( !( *it )->isLocked() )
499 return ( *it )->color();
534 if ( format.
toLower() ==
"svg" )
554 QImage image( size, QImage::Format_ARGB32_Premultiplied );
568 QImage preview(
QSize( 100, 100 ), QImage::Format_ARGB32_Premultiplied );
583 if ( expressionContext )
592 static_cast<QgsLineSymbolV2*
>( this )->renderPolyline( poly,
nullptr, context );
598 static_cast<QgsFillSymbolV2*
>( this )->renderPolygon( polygon,
nullptr,
nullptr, context );
625 Q_ASSERT( 0 &&
"unknown symbol type" );
639 double scaleFactor = 1.0;
645 ( *it )->toSld( doc, element, props );
669 if ( effect && effect->
enabled() )
675 generatorLayer->render( context );
682 generatorLayer->render( context );
694 attributes.
unite(( *sIt )->usedAttributes() );
719 bool deleteSegmentizedGeometry =
false;
733 deleteSegmentizedGeometry =
true;
751 QgsDebugMsg(
"point can be drawn only with marker symbol!" );
757 static_cast<QgsMarkerSymbolV2*
>( this )->renderPoint( pt, &feature, context, layer, selected );
764 context.
painter()->
drawRect( static_cast<QgsMarkerSymbolV2*>(
this )->bounds( pt, context, feature ) );
773 QgsDebugMsg(
"linestring can be drawn only with line symbol!" );
777 static_cast<QgsLineSymbolV2*
>( this )->renderPolyline( pts, &feature, context, layer, selected );
786 QgsDebugMsg(
"polygon can be drawn only with fill symbol!" );
790 static_cast<QgsFillSymbolV2*
>( this )->renderPolygon( pts, ( !holes.
isEmpty() ? &holes : nullptr ), &feature, context, layer, selected );
800 QgsDebugMsg(
"multi-point can be drawn only with marker symbol!" );
812 static_cast<QgsMarkerSymbolV2*
>( this )->renderPoint( pt, &feature, context, layer, selected );
824 QgsDebugMsg(
"multi-linestring can be drawn only with line symbol!" );
836 for (
unsigned int i = 0; i < num && wkbPtr; ++i )
840 if ( geomCollection )
845 static_cast<QgsLineSymbolV2*
>( this )->renderPolyline( pts, &feature, context, layer, selected );
855 QgsDebugMsg(
"multi-polygon can be drawn only with fill symbol!" );
870 for (
unsigned int i = 0; i < num && wkbPtr; ++i )
874 if ( geomCollection )
880 static_cast<QgsFillSymbolV2*
>( this )->renderPolygon( pts, ( !holes.
isEmpty() ? &holes : nullptr ), &feature, context, layer, selected );
890 wkbPtr >> nGeometries;
892 if ( nGeometries == 0 )
907 if ( drawVertexMarker )
931 currentVertexMarkerSize );
935 if ( deleteSegmentizedGeometry )
937 delete segmentizedGeometry;
946 return mSymbolRenderContext;
953 : mRenderContext( c ),
954 mExpressionContextScope( nullptr ),
956 mMapUnitScale( mapUnitScale ),
958 mSelected( selected ),
967 delete mExpressionContextScope;
997 return mExpressionContextScope;
1002 mExpressionContextScope = contextScope;
1051 double origAngle =
angle();
1052 double angleDiff = ang - origAngle;
1068 return markerLayer->
angle();
1086 const double symbolRotation =
angle();
1114 const double symbolRotation =
angle();
1143 if ( !layerAngleDD || *layerAngleDD != *symbolDD )
1149 if ( !layerAngleDD || *layerAngleDD != *( rotatedDD.
data() ) )
1159 double origSize =
size();
1171 markerLayer->
setSize( markerLayer->
size() * s / origSize );
1176 markerLayer->
offset().
y() * s / origSize ) );
1189 double lsize = markerLayer->
size();
1190 if ( lsize > maxSize )
1223 if ( unit != markerLayer->
sizeUnit() )
1259 const double symbolSize =
size();
1286 markerLayer->
offset().
x() / symbolSize,
1287 markerLayer->
offset().
y() / symbolSize, dd ) );
1295 const double symbolSize =
size();
1327 if ( !layerSizeDD || *layerSizeDD != *symbolDD )
1336 if ( !layerSizeDD || *layerSizeDD != *( scaledDD.
data() ) )
1341 if ( layerOffsetDD && *layerOffsetDD != *( scaledOffsetDD.
data() ) )
1375 static QPointF nullPoint( 0, 0 );
1378 if ( effect && effect->
enabled() )
1400 if ( layerIdx != -1 )
1408 renderPointUsingLayer( markerLayer, point, symbolContext );
1421 renderPointUsingLayer( markerLayer, point, symbolContext );
1438 if ( bound.isNull() )
1439 bound = symbolLayer->
bounds( point, symbolContext );
1441 bound = bound.
united( symbolLayer->
bounds( point, symbolContext ) );
1469 double origWidth =
width();
1495 double maxWidth = 0;
1505 if ( width > maxWidth )
1514 const double symbolWidth =
width();
1549 const double symbolWidth =
width();
1579 if ( !layerWidthDD || *layerWidthDD != *symbolDD )
1588 if ( !layerWidthDD || *layerWidthDD != *( scaledDD.
data() ) )
1593 if ( layerOffsetDD && *layerOffsetDD != *( scaledOffsetDD.
data() ) )
1606 if ( layerIdx != -1 )
1614 renderPolylineUsingLayer( lineLayer, points, symbolContext );
1627 renderPolylineUsingLayer( lineLayer, points, symbolContext );
1641 if ( effect && effect->
enabled() )
1683 if ( layerIdx != -1 )
1689 renderPolygonUsingLayer( symbolLayer, points, rings, symbolContext );
1699 renderPolygonUsingLayer( symbolLayer, points, rings, symbolContext );
1710 if ( effect && effect->
enabled() )
1712 QRectF bounds = polygonBounds( points, rings );
1717 p->translate( bounds.
topLeft() );
1728 delete translatedRings;
1752 for ( ; it != rings->
constEnd(); ++it )
1754 bounds = bounds.
united(( *it ).boundingRect() );
1767 for ( ; it != rings->
constEnd(); ++it )
1769 translatedRings->
append(( *it ).translated( dx, dy ) );
1771 return translatedRings;
QgsFeatureId id() const
Get the feature ID for this feature.
virtual void renderPoint(QPointF point, QgsSymbolV2RenderContext &context)=0
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
QgsFillSymbolV2(const QgsSymbolLayerV2List &layers=QgsSymbolLayerV2List())
void setForceVectorOutput(bool force)
void setLocked(bool locked)
static int coordDimensions(Type type)
Returns the coordinate dimension of the geometry type as an integer.
bool deleteSymbolLayer(int index)
delete symbol layer at specified index
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
void setViewBox(const QRect &viewBox)
A rectangle specified with double values.
void renderPolygon(const QPolygonF &points, QList< QPolygonF > *rings, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
static QgsMarkerSymbolV2 * createSimple(const QgsStringMap &properties)
Create a marker symbol with one symbol layer: SimpleMarker with specified properties.
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent...
OutputUnit
The unit of the output.
virtual void setOutputUnit(QgsSymbolV2::OutputUnit unit)
bool mClipFeaturesToExtent
void setDataDefinedAngle(const QgsDataDefined &dd)
Set data defined angle for whole symbol (including all symbol layers).
A container class for data source field mapping or expression.
QgsMapUnitScale sizeMapUnitScale() const
Returns the size map unit scale for the whole symbol.
void setSize(const QSize &size)
virtual double width() const
virtual QgsLineSymbolV2 * clone() const override
static QgsConstWkbPtr clippedLineWKB(QgsConstWkbPtr wkb, const QgsRectangle &clipExtent, QPolygonF &line)
Reads a polyline from WKB and clips it to clipExtent.
void setRenderHint(RenderHint hint, bool on)
const QgsVectorLayer * mLayer
double x() const
Returns the point's x-coordinate.
OutputUnit sizeUnit() const
Returns the size units for the whole symbol (including all symbol layers).
virtual bool isCompatibleWithSymbol(QgsSymbolV2 *symbol) const
Returns if the layer can be used below the specified symbol.
QSet< QString > usedAttributes() const
Return a list of attributes required to render this feature.
QString field() const
Get the field which this QgsDataDefined represents.
virtual QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context)
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
double yMaximum() const
Get the y maximum value (top side of rectangle)
void setDataDefinedSize(const QgsDataDefined &dd)
Set data defined size for whole symbol (including all symbol layers).
QgsAbstractGeometryV2 * geometry() const
Returns the underlying geometry store.
bool save(const QString &fileName, const char *format, int quality) const
static QString encodeColor(const QColor &color)
static QString encodeSldUom(QgsSymbolV2::OutputUnit unit, double *scaleFactor)
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
double size() const
Returns the size for the whole symbol, which is the maximum size of all marker symbol layers in the s...
QgsDataDefined dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
static QgsFillSymbolV2 * createSimple(const QgsStringMap &properties)
Create a fill symbol with one symbol layer: SimpleFill with specified properties. ...
bool contains(const QgsRectangle &rect) const
return true when rectangle contains other rectangle
const T & at(int i) const
VertexMarkerType
Editing vertex markers.
void setOffset(QPointF offset)
QPolygonF translated(qreal dx, qreal dy) const
bool enabled() const
Returns whether the effect is enabled.
Base class for visual effects which can be applied to QPicture drawings.
bool changeSymbolLayer(int index, QgsSymbolLayerV2 *layer)
delete layer at specified index and set a new one
QgsSymbolV2RenderContext(QgsRenderContext &c, QgsSymbolV2::OutputUnit u, qreal alpha=1.0, bool selected=false, int renderHints=0, const QgsFeature *f=nullptr, const QgsFields *fields=nullptr, const QgsMapUnitScale &mapUnitScale=QgsMapUnitScale())
ScaleMethod scaleMethod()
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
static void _getPoint(QPointF &pt, QgsRenderContext &context, const QgsPointV2 *point)
Creates a point in screen coordinates from a QgsPointV2 in map coordinates.
Abstract base class for all geometries.
QgsMapUnitScale mapUnitScale() const
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
QString expressionString() const
Returns the expression string of this QgsDataDefined.
const QgsRectangle & extent() const
QgsSymbolV2::OutputUnit sizeUnit() const
Multi point geometry collection.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void drawLine(const QLineF &line)
void renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false, int currentVertexMarkerType=0, int currentVertexMarkerSize=0)
Render a feature.
const QgsCoordinateTransform * coordinateTransform() const
void setExpressionContextScope(QgsExpressionContextScope *contextScope)
Set an expression scope for this symbol.
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
virtual void removeDataDefinedProperty(const QString &property)
Removes a data defined property from the layer.
void drawPreviewIcon(QPainter *painter, QSize size, QgsRenderContext *customContext=nullptr)
Draw icon of the symbol that occupyies area given by size using the painter.
void setVariable(const QString &name, const QVariant &value)
Convenience method for setting a variable in the context scope by name and value. ...
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
void setSizeUnit(OutputUnit unit)
Sets the size units for the whole symbol (including all symbol layers).
static double pixelSizeScaleFactor(const QgsRenderContext &c, QgsSymbolV2::OutputUnit u, const QgsMapUnitScale &scale=QgsMapUnitScale())
Returns scale factor painter units -> pixel dimensions.
void setWidth(double width)
QgsDataDefined * scaleWholeSymbol(double scaleFactor, const QgsDataDefined &dd)
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the size map unit scale for the whole symbol (including all symbol layers).
QgsDataDefined dataDefinedWidth() const
Returns data defined size for whole symbol (including all symbol layers).
void setMapUnitScale(const QgsMapUnitScale &scale)
void setAngle(double angle)
const QgsVectorLayer * layer() const
virtual void startRender(QgsSymbolV2RenderContext &context)=0
double y() const
Returns the point's y-coordinate.
QColor fromHsv(int h, int s, int v, int a)
QgsWKBTypes::Type readHeader() const
void drawRect(const QRectF &rectangle)
Perform transforms between map coordinates and device coordinates.
void setUseExpression(bool use)
Controls if the field or the expression part is active.
void setColor(const QColor &color)
Mixed units in symbol layers.
void transformInPlace(double &x, double &y) const
Transform device coordinates to map coordinates.
static QgsRenderContext createRenderContext(QPainter *p)
Creates a render context for a pixel based device.
QString readEntry(const QString &scope, const QString &key, const QString &def=QString::null, bool *ok=nullptr) const
QString number(int n, int base)
QgsSymbolLayerV2List mLayers
int count(const T &value) const
void append(const T &value)
QgsSymbolLayerV2List cloneLayers() const
Retrieve a cloned list of all layers that make up this symbol.
void setOffset(double offset)
bool appendSymbolLayer(QgsSymbolLayerV2 *layer)
Append symbol layer at the end of the list Ownership will be transferred.
void startRender(QgsRenderContext &context, const QgsFields *fields=nullptr)
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
void fill(uint pixelValue)
double xMaximum() const
Get the x maximum value (right side of rectangle)
static double convertToPainterUnits(const QgsRenderContext &c, double size, QgsSymbolV2::OutputUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale())
Converts a size from the specied units to painter units.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
Utility class for identifying a unique vertex within a geometry.
double z() const
Returns the point's z-coordinate.
qreal alpha() const
Get alpha transparency 1 for opaque, 0 for invisible.
static QgsLineSymbolV2 * createSimple(const QgsStringMap &properties)
Create a line symbol with one symbol layer: SimpleLine with specified properties. ...
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
static bool isCurvedType(Type type)
Returns true if the WKB type is a curved type or can contain curved geometries.
void setPen(const QColor &color)
Q_DECL_DEPRECATED bool isSymbolLayerCompatible(SymbolType layerType)
check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line)
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
void setRenderingPass(int renderingPass)
#define DEFAULT_SCALE_METHOD
void setLayer(const QgsVectorLayer *layer)
const QgsFields * fields() const
Returns the field map associated with the feature.
Point geometry type, with support for z-dimension and m-values.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual void setWidth(double width)
static QgsStyleV2 * defaultStyle()
return default application-wide style
void renderPolyline(const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
QgsMarkerSymbolV2(const QgsSymbolLayerV2List &layers=QgsSymbolLayerV2List())
void setAngle(double angle)
double angle() const
Returns the marker angle for the whole symbol.
void setAngle(double angle)
Sets the angle for the whole symbol.
void setSizeUnit(QgsSymbolV2::OutputUnit unit)
QRectF bounds(QPointF point, QgsRenderContext &context, const QgsFeature &feature=QgsFeature()) const
Returns the approximate bounding box of the marker symbol, which includes the bounding box of all sym...
Draw bounds of symbols (for debugging/testing)
const QgsMapUnitScale & sizeMapUnitScale() const
void setBrush(const QBrush &brush)
void setPainter(QPainter *p)
void setSize(double size)
Sets the size for the whole symbol.
QGis::WkbType wkbType() const
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
qreal mAlpha
Symbol opacity (in the range 0 - 1)
virtual int partCount() const =0
Returns count of parts contained in the geometry.
QgsSymbolV2RenderContext & operator=(const QgsSymbolV2RenderContext &)
QRectF united(const QRectF &rectangle) const
virtual void renderPolygonOutline(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)
QgsSymbolV2(SymbolType type, const QgsSymbolLayerV2List &layers)
virtual bool nextVertex(QgsVertexId &id, QgsPointV2 &vertex) const =0
Returns next vertex id and coordinates.
QgsDataDefined * rotateWholeSymbol(double additionalRotation, const QgsDataDefined &dd)
Single scope for storing variables and functions for use within a QgsExpressionContext.
virtual bool hasDataDefinedProperties() const
Checks whether the layer has any associated data defined properties.
static void drawVertexMarker(double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize)
Draws a vertex symbol at (screen) coordinates x, y.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
QgsSymbolV2::ScaleMethod scaleMethod() const
QgsSymbolV2::SymbolType type() const
bool useExpression() const
Returns if the field or the expression part is active.
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
virtual void renderPolyline(const QPolygonF &points, QgsSymbolV2RenderContext &context)=0
QgsSymbolV2 * symbol(const QString &name)
return a NEW copy of symbol
virtual QgsFillSymbolV2 * clone() const override
QImage bigSymbolPreviewImage(QgsExpressionContext *expressionContext=nullptr)
Returns a large (roughly 100x100 pixel) preview image for the symbol.
void setFileName(const QString &fileName)
void exportImage(const QString &path, const QString &format, QSize size)
export symbol as image format. PNG and SVG supported
QgsExpressionContext & expressionContext()
Gets the expression context.
virtual QgsAbstractGeometryV2 * segmentize() const
Returns a version of the geometry without curves.
void renderUsingLayer(QgsSymbolLayerV2 *layer, QgsSymbolV2RenderContext &context)
Renders a context using a particular symbol layer without passing in a geometry.
SymbolType
Type of the symbol.
~QgsSymbolV2RenderContext()
void setDataDefinedWidth(const QgsDataDefined &dd)
Set data defined width for whole symbol (including all symbol layers).
int numGeometries() const
Returns the number of geometries within the collection.
QgsExpressionContextScope * expressionContextScope()
This scope is always available when a symbol of this type is being rendered.
Contains information about the context of a rendering operation.
QRectF boundingRect() const
QgsDataDefined dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
int wkbSize() const
Returns the size of the WKB in asWkb().
void stopRender(QgsRenderContext &context)
static QgsConstWkbPtr _getLineString(QPolygonF &pts, QgsRenderContext &context, QgsConstWkbPtr wkb, bool clipToExtent=true)
Creates a line string in screen coordinates from a wkb string in map coordinates. ...
bool insertSymbolLayer(int index, QgsSymbolLayerV2 *layer)
Insert symbol layer to specified index Ownership will be transferred.
QSet< T > & unite(const QSet< T > &other)
static QgsSymbolV2 * defaultSymbol(QGis::GeometryType geomType)
return new default symbol for specified geometry type
Struct for storing maximum and minimum scales for measurements in map units.
void insert(int i, const T &value)
static QgsConstWkbPtr _getPolygon(QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, QgsConstWkbPtr wkb, bool clipToExtent=true)
Creates a polygon in screen coordinates from a wkb string in map coordinates.
QImage asImage(QSize size, QgsRenderContext *customContext=nullptr)
Generate symbol as image.
QgsRenderContext & renderContext()
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
virtual QgsDataDefined * getDataDefinedProperty(const QString &property) const
Returns the data defined property corresponding to the specified property key.
static QgsProject * instance()
access to canonical QgsProject instance
QgsSymbolV2::OutputUnit outputUnit() const
const QgsGeometry * constGeometry() const
Gets a const pointer to the geometry object associated with this feature.
const QgsAbstractGeometryV2 * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
void renderPoint(QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
void translate(const QPointF &offset)
bool testFlag(Flag flag) const
Check whether a particular flag is enabled.
const QgsMapToPixel & mapToPixel() const
virtual void setColor(const QColor &color)
The fill color.
static Type flatType(Type type)
Returns the flat type for a WKB type.
QgsSymbolLayerV2 * takeSymbolLayer(int index)
Remove symbol layer from the list and return pointer to it.
bool hasDefaultValues() const
Returns whether the data defined container is set to all the default values, ie, disabled, with empty expression and no assigned field.
double outputPixelSize(double size) const
double outputLineWidth(double width) const
QgsSymbolLayerV2 * symbolLayer(int layer)
Returns a specific symbol layers contained in the symbol.
QgsExpressionContextScope * popScope()
Removes the last scope from the expression context and return it.
const_iterator constEnd() const
virtual void drawPreviewIcon(QgsSymbolV2RenderContext &context, QSize size)=0
const_iterator constBegin() const
static QString displayString(Type type)
Returns a display string type for a WKB type, eg the geometry name used in WKT geometry representatio...
Draw map such that there are no problems between adjacent tiles.
double width() const
Width of the rectangle.
static void trimPolygon(QPolygonF &pts, const QgsRectangle &clipRect)
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
void setSize(double size)
void setAngle(double angle)
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent...
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
virtual void end(QgsRenderContext &context)
Ends interception of paint operations to a render context, and draws the result to the render context...
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
const unsigned char * asWkb() const
Returns the buffer containing this geometry in WKB format.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbolV2 *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbolV2 to an expression context.
double xMinimum() const
Get the x minimum value (left side of rectangle)
virtual void stopRender(QgsSymbolV2RenderContext &context)=0
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
void setExpressionString(const QString &expr)
Sets the expression for this QgsDataDefined.
void setOutputUnit(QgsSymbolV2::OutputUnit u)
void setAlpha(qreal alpha)
Set alpha transparency 1 for opaque, 0 for invisible.
bool hasDataDefinedProperties() const
Returns whether the symbol utilises any data defined properties.
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
void setGeometry(const QgsAbstractGeometryV2 *geometry)
Sets pointer to original (unsegmentized) geometry.
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
virtual void begin(QgsRenderContext &context)
Begins intercepting paint operations to a render context.
QgsSymbolV2RenderContext * symbolRenderContext()
Returns the symbol render context.
QgsLineSymbolV2(const QgsSymbolLayerV2List &layers=QgsSymbolLayerV2List())
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
virtual QgsMarkerSymbolV2 * clone() const override
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the layer.
double height() const
Height of the rectangle.
virtual Q_DECL_DEPRECATED void setDataDefinedProperty(const QString &property, const QString &expressionString)
Sets a data defined expression for a property.