15 #ifndef QGSSYMBOLLAYERV2_H 16 #define QGSSYMBOLLAYERV2_H 20 #define M_PI 3.14159265358979323846 23 #define DEG2RAD(x) ((x)*M_PI/180) 24 #define DEFAULT_SCALE_METHOD QgsSymbolV2::ScaleDiameter 30 #include <QDomDocument> 31 #include <QDomElement> 85 virtual QString layerType()
const = 0;
99 virtual QString ogrFeatureStyle(
double mmScaleFactor,
double mapUnitScaleFactor )
const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor );
return QString(); }
117 virtual bool isCompatibleWithSymbol(
QgsSymbolV2* symbol )
const;
146 Q_DECL_DEPRECATED
virtual const QgsExpression* dataDefinedProperty(
const QString& property )
const;
151 Q_DECL_DEPRECATED
virtual QString dataDefinedPropertyString(
const QString& property )
const;
156 Q_DECL_DEPRECATED
virtual void setDataDefinedProperty(
const QString& property,
const QString& expressionString );
184 virtual void removeDataDefinedProperty(
const QString& property );
191 virtual void removeDataDefinedProperties();
197 virtual bool hasDataDefinedProperties()
const;
208 virtual bool hasDataDefinedProperty(
const QString& property )
const;
261 virtual Qt::PenStyle dxfPenStyle()
const;
267 virtual Qt::BrushStyle dxfBrushStyle()
const;
296 static const bool selectionIsOpaque =
true;
297 static const bool selectFillBorder =
false;
298 static const bool selectFillStyle =
false;
306 Q_DECL_DEPRECATED
virtual void prepareExpressions(
const QgsFields* fields,
double scale = -1.0 );
324 void saveDataDefinedProperties(
QgsStringMap& stringMap )
const;
331 void restoreDataDefinedProperties(
const QgsStringMap& stringMap );
451 double angle()
const {
return mAngle; }
476 double size()
const {
return mSize; }
645 void markerOffset(
QgsSymbolV2RenderContext& context,
double width,
double height,
double& offsetX,
double& offsetY )
const;
650 double& offsetX,
double& offsetY,
698 virtual void setWidth(
double width ) { mWidth = width; }
699 virtual double width()
const {
return mWidth; }
701 double offset()
const {
return mOffset; }
748 double angle()
const {
return mAngle; }
QgsSymbolV2::SymbolType mType
static const QString EXPR_DISTANCE_Y
Class for parsing and evaluation of expressions (formerly called "search strings").
static const QString EXPR_CHAR
static const QString EXPR_OUTLINE_COLOR
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
void setLocked(bool locked)
static const QString EXPR_DISPLACEMENT_Y
static const QString EXPR_JOINSTYLE
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
OutputUnit
The unit of the output.
virtual void setOutputUnit(QgsSymbolV2::OutputUnit unit)
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
A container class for data source field mapping or expression.
static const QString EXPR_BORDER_COLOR
virtual void setOutlineColor(const QColor &color)
Set outline color.
QDomNode appendChild(const QDomNode &newChild)
static const QString EXPR_USE_WHOLE_SHAPE
static const QString EXPR_REFERENCE2_Y
virtual QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context)
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
QgsSymbolV2::OutputUnit sizeUnit() const
Returns the units for the symbol's size.
virtual QgsMapUnitScale mapUnitScale() const
double size() const
Returns the symbol size.
static const QString EXPR_DISPLACEMENT_X
virtual QColor outlineColor() const
Get outline color.
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker's size.
QMap< QString, QgsDataDefined *> mDataDefinedProperties
static const QString EXPR_WIDTH
static const QString EXPR_CUSTOMDASH
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
Base class for visual effects which can be applied to QPicture drawings.
QgsPaintEffect * mPaintEffect
Container of fields for a vector layer.
static const QString EXPR_BLUR_RADIUS
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
static const QString EXPR_COORDINATE_MODE
static const QString EXPR_COLOR2
static const QString EXPR_VERTICAL_ANCHOR_POINT
const QgsMapUnitScale & offsetMapUnitScale() const
static const QString EXPR_OFFSET_ALONG_LINE
QgsMapUnitScale mWidthMapUnitScale
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
QgsMapUnitScale mOffsetMapUnitScale
static const QString EXPR_OFFSET
QgsSymbolV2::OutputUnit mOffsetUnit
void setWidthUnit(QgsSymbolV2::OutputUnit unit)
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the SLD element following the SLD v1.1 specs.
static const QString EXPR_SIZE
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol's offset.
virtual void startRender(QgsSymbolV2RenderContext &context)=0
static const QString EXPR_JOIN_STYLE
static const QString EXPR_FILL_STYLE
virtual QgsSymbolV2::OutputUnit outputUnit() const
static const QString EXPR_REFERENCE1_Y
int renderingPass() const
static const QString EXPR_BORDER_STYLE
virtual double width() const
static const QString EXPR_REFERENCE2_X
static const QString EXPR_REFERENCE2_ISCENTROID
virtual double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
Mixed units in symbol layers.
static const QString EXPR_LINEWIDTH
static const QString EXPR_PLACEMENT
static const QString EXPR_FILL_COLOR
static const QString EXPR_SPREAD
void setOffset(double offset)
virtual QColor fillColor() const
Get fill color.
static const QString EXPR_LINEANGLE
static const QString EXPR_ALPHA
const QgsMapUnitScale & widthMapUnitScale() const
QgsSymbolV2::OutputUnit mWidthUnit
void setRenderingPass(int renderingPass)
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
virtual void setWidth(double width)
void setAngle(double angle)
QgsSymbolV2::ScaleMethod mScaleMethod
Marker size scaling method.
void setSizeUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol's size.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
static const QString EXPR_FILL
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
virtual QColor color() const
The fill color.
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units for the symbol's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
static const QString EXPR_FILE
double mAngle
Marker rotation angle, in degrees clockwise from north.
static const QString EXPR_CAPSTYLE
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
double mLineAngle
Line rotation angle (see setLineAngle() for details)
static const QString EXPR_OUTLINE_STYLE
virtual void setFillColor(const QColor &color)
Set fill color.
static const QString EXPR_DISTANCE
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)
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
static const QString EXPR_COLOR
static const QString EXPR_WIDTH_BORDER
static const QString EXPR_SVG_FILE
static const QString EXPR_ANGLE
virtual QString layerType() const =0
Returns a string that represents this layer type.
static const QString EXPR_DISTANCE_X
static const QString EXPR_REFERENCE1_X
virtual QgsSymbolV2 * subSymbol()
SymbolType
Type of the symbol.
static const QString EXPR_GRADIENT_TYPE
static const QString EXPR_OUTLINE_WIDTH
Contains information about the context of a rendering operation.
VerticalAnchorPoint
Symbol vertical anchor points.
static const QString EXPR_SVG_FILL_COLOR
QgsSymbolV2::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker's size.
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.
QgsSymbolV2::OutputUnit offsetUnit() const
static const QString EXPR_SVG_OUTLINE_COLOR
static const QString EXPR_NAME
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolV2RenderContext &context) const
get line width
static const QString EXPR_IGNORE_RINGS
static const QString EXPR_COLOR_BORDER
static const QString EXPR_REFERENCE1_ISCENTROID
static const QString EXPR_ROTATION
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
QgsSymbolV2::OutputUnit mOffsetUnit
Offset units.
virtual void setColor(const QColor &color)
The fill color.
Abstract base class for marker symbol layers.
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point.
QgsSymbolV2::OutputUnit mSizeUnit
Marker size unit.
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
static const QString EXPR_OUTLINE
HorizontalAnchorPoint
Symbol horizontal anchor points.
static const QString EXPR_SVG_OUTLINE_WIDTH
virtual void drawPreviewIcon(QgsSymbolV2RenderContext &context, QSize size)=0
static const QString EXPR_SYMBOL_NAME
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setSize(double size)
Sets the symbol size.
void setAngle(double angle)
Sets the rotation angle for the marker.
static const QString EXPR_MAX_DISTANCE
QgsSymbolV2::SymbolType type() const
static const QString EXPR_LINE_STYLE
virtual bool setSubSymbol(QgsSymbolV2 *symbol)
set layer's subsymbol. takes ownership of the passed symbol
QPointF mOffset
Marker offset.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
static const QString EXPR_INTERVAL
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
QgsSymbolV2::OutputUnit widthUnit() const
static const QString EXPR_HEIGHT
static const QString EXPR_HORIZONTAL_ANCHOR_POINT