16 #ifndef QGSMARKERSYMBOLLAYERV2_H 17 #define QGSMARKERSYMBOLLAYERV2_H 22 #define DEFAULT_SIMPLEMARKER_NAME "circle" 23 #define DEFAULT_SIMPLEMARKER_COLOR QColor(255,0,0) 24 #define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor(0,0,0) 25 #define DEFAULT_SIMPLEMARKER_JOINSTYLE Qt::BevelJoin 26 #define DEFAULT_SIMPLEMARKER_SIZE DEFAULT_POINT_SIZE 27 #define DEFAULT_SIMPLEMARKER_ANGLE 0 80 static bool shapeIsFilled(
Shape shape );
111 static Shape decodeShape(
const QString& name,
bool* ok =
nullptr );
129 bool prepareMarkerShape(
Shape shape );
133 bool prepareMarkerPath(
Shape symbol );
221 QgsSimpleMarkerSymbolLayerV2(
Shape shape = Circle,
249 QgsSimpleMarkerSymbolLayerV2*
clone()
const override;
377 Q_DECL_DEPRECATED
bool prepareShape(
const QString& name =
QString() );
379 Q_DECL_DEPRECATED
bool prepareShape(
const QString& name,
QPolygonF &polygon )
const;
420 static const int mMaximumCacheWidth = 3000;
476 #define DEFAULT_SVGMARKER_NAME "/crosses/Star1.svg" 477 #define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE 478 #define DEFAULT_SVGMARKER_ANGLE 0 513 void setPath(
const QString& path );
559 #define POINT2MM(x) ( (x) * 25.4 / 72 ) // point is 1/72 of inch 560 #define MM2POINT(x) ( (x) * 72 / 25.4 ) 562 #define DEFAULT_FONTMARKER_FONT "Dingbats" 563 #define DEFAULT_FONTMARKER_CHR QChar('A') 564 #define DEFAULT_FONTMARKER_SIZE POINT2MM(12) 565 #define DEFAULT_FONTMARKER_COLOR QColor(Qt::black) 566 #define DEFAULT_FONTMARKER_BORDERCOLOR QColor(Qt::white) 567 #define DEFAULT_FONTMARKER_JOINSTYLE Qt::MiterJoin 568 #define DEFAULT_FONTMARKER_ANGLE 0 664 double mOutlineWidth;
667 Qt::PenJoinStyle mPenJoinStyle;
virtual void renderPoint(QPointF point, QgsSymbolV2RenderContext &context)=0
Renders a marker at the specified point.
QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
void setOutlineStyle(Qt::PenStyle outlineStyle)
Sets the marker's outline style (eg solid, dashed, etc)
void setOutlineColor(const QColor &color) override
Set outline color.
void setPenJoinStyle(Qt::PenJoinStyle style)
Set outline join style.
QgsSymbolV2::OutputUnit outputUnit() const override
OutputUnit
The unit of the output.
const QgsMapUnitScale & outlineWidthMapUnitScale() const
Returns the map scale for the width of the marker's outline.
QgsMapUnitScale mOutlineWidthMapUnitScale
Outline width map unit scale.
double outlineWidth() const
void startRender(QgsSymbolV2RenderContext &context) override
virtual QgsSymbolLayerV2 * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qt::PenStyle outlineStyle() const
Returns the marker's outline style (eg solid, dashed, etc)
#define DEFAULT_FONTMARKER_COLOR
void renderPoint(QPointF point, QgsSymbolV2RenderContext &context) override
Renders a marker at the specified point.
virtual QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context)
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
Abstract base class for simple marker symbol layers.
virtual QSet< QString > usedAttributes() const
Returns the set of attributes referenced by the layer.
QgsSymbolV2::OutputUnit mOutlineWidthUnit
void setOutlineColor(const QColor &c) override
Set outline color.
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
Set outline width map unit scale.
#define DEFAULT_SIMPLEMARKER_ANGLE
QString fontFamily() const
#define DEFAULT_FONTMARKER_CHR
void setOutlineWidth(double w)
Sets the width of the marker's outline.
#define DEFAULT_SIMPLEMARKER_COLOR
QImage mCache
Cached image of marker, if using cached version.
void setFillColor(const QColor &color) override
Set fill color.
bool mUsingCache
True if using cached images of markers for drawing.
static Shape decodeShape(const QString &name, bool *ok=nullptr)
Attempts to decode a string representation of a shape name to the corresponding shape.
void stopRender(QgsSymbolV2RenderContext &context) override
virtual bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const
write as DXF
void setOutlineWidth(double w)
QColor fillColor() const override
Get fill color.
double mOutlineWidth
Outline width.
void setShape(Shape shape)
Sets the rendered marker shape.
QMap< QString, QString > QgsStringMap
void setMapUnitScale(const QgsMapUnitScale &scale) override
const QgsMapUnitScale & outlineWidthMapUnitScale() const
#define DEFAULT_SVGMARKER_ANGLE
QPainterPath mPath
Painter path representing shape. If mPolygon is empty then the shape is stored in mPath...
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
virtual double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit u)
Sets the unit for the width of the marker's outline.
Q_DECL_DEPRECATED QString name() const
QColor mBorderColor
Outline color.
void setFontFamily(const QString &family)
#define DEFAULT_SCALE_METHOD
Qt::PenStyle mOutlineStyle
Outline style.
void setFillColor(const QColor &color) override
Set fill color.
QColor outlineColor() const override
Get outline color.
QColor borderColor() const
Returns the marker's border color.
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
static QString encodeShape(Shape shape)
Encodes a shape to its string representation.
#define DEFAULT_FONTMARKER_ANGLE
QgsMapUnitScale mOutlineWidthMapUnitScale
Qt::PenJoinStyle penJoinStyle() const
Get outline join style.
virtual QColor color() const
The fill color.
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
QgsSymbolV2::OutputUnit mOutlineWidthUnit
Outline width units.
#define DEFAULT_SVGMARKER_SIZE
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)
QFontMetrics * mFontMetrics
void setOutlineWidth(double width)
Set outline width.
QBrush mBrush
QBrush corresponding to marker's fill style.
virtual QString layerType() const =0
Returns a string that represents this layer type.
double outlineWidth() const
Get outline width.
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's outline.
#define DEFAULT_FONTMARKER_SIZE
virtual QgsSymbolV2 * subSymbol()
void startRender(QgsSymbolV2RenderContext &context) override
#define DEFAULT_FONTMARKER_FONT
#define DEFAULT_SVGMARKER_NAME
void setBorderColor(const QColor &color)
Sets the marker's border color.
const QgsMapUnitScale & outlineWidthMapUnitScale() const
Get outline width map unit scale.
#define DEFAULT_SIMPLEMARKER_SIZE
QgsSymbolV2::OutputUnit outlineWidthUnit() const
Get outline width unit.
Shape shape() const
Returns the shape for the rendered marker symbol.
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
Struct for storing maximum and minimum scales for measurements in map units.
QgsMapUnitScale mapUnitScale() const override
QImage mSelCache
Cached image of selected marker, if using cached version.
Shape
Marker symbol shapes.
QPen mSelPen
QPen to use as outline of selected symbols.
QPen mPen
QPen corresponding to marker's outline style.
double outlineWidth() const
Returns the width of the marker's outline.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's outline join style (eg miter, bevel, etc).
QColor fillColor() const override
Get fill color.
virtual void setColor(const QColor &color)
The fill color.
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's outline join style (eg miter, bevel, etc).
Abstract base class for marker symbol layers.
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
Set outline width unit.
QgsSymbolV2::OutputUnit outlineWidthUnit() const
Qt::PenJoinStyle mPenJoinStyle
Outline pen join style.
Shape mShape
Symbol shape.
#define DEFAULT_SIMPLEMARKER_JOINSTYLE
QgsSymbolV2::OutputUnit outlineWidthUnit() const
Returns the unit for the width of the marker's outline.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbolV2.
virtual bool setSubSymbol(QgsSymbolV2 *symbol)
set layer's subsymbol. takes ownership of the passed symbol
virtual void stopRender(QgsSymbolV2RenderContext &context)=0
QColor outlineColor() const override
Get outline color.
QPolygonF mPolygon
Polygon of points in shape. If polygon is empty then shape is using mPath.
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
Q_DECL_DEPRECATED void setName(const QString &name)
QColor outlineColor() const override
Get outline color.
void setCharacter(QChar ch)
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an outline...
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR
QBrush mSelBrush
QBrush to use as fill of selected symbols.
void setOutlineColor(const QColor &color) override
Set outline color.