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::ScaleArea
30 #include <QDomDocument>
31 #include <QDomElement>
49 virtual void setColor(
const QColor& color ) { mColor = color; }
50 virtual QColor
color()
const {
return mColor; }
54 virtual QString layerType()
const = 0;
61 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
62 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
64 virtual QString
ogrFeatureStyle(
double mmScaleFactor,
double mapUnitScaleFactor )
const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor );
return QString(); }
87 virtual QSet<QString> usedAttributes()
const;
89 virtual const QgsExpression* dataDefinedProperty(
const QString& property )
const;
90 virtual QString dataDefinedPropertyString(
const QString& property )
const;
91 virtual void setDataDefinedProperty(
const QString& property,
const QString& expressionString );
92 virtual void removeDataDefinedProperty(
const QString& property );
93 virtual void removeDataDefinedProperties();
97 : mType( type ), mLocked( locked ), mRenderingPass( 0 ) {}
107 static const bool selectionIsOpaque =
true;
108 static const bool selectFillBorder =
false;
109 static const bool selectFillStyle =
false;
112 virtual QgsExpression* expression(
const QString& property );
114 void saveDataDefinedProperties(
QgsStringMap& stringMap )
const;
129 double angle()
const {
return mAngle; }
132 double size()
const {
return mSize; }
140 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
142 virtual void writeSldMarker( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
143 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg(
layerType() ) ) ); }
157 static QPointF _rotatedOffset(
const QPointF& offset,
double angle );
173 virtual void renderPolygonOutline(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );
175 virtual void setWidth(
double width ) { mWidth = width; }
176 virtual double width()
const {
return mWidth; }
193 virtual void renderPolygon(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context ) = 0;
198 double angle()
const {
return mAngle; }
203 void _renderPolygon( QPainter* p,
const QPolygonF& points,
const QList<QPolygonF>* rings );
208 class QgsSymbolLayerV2Widget;