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>
50 virtual QColor
color()
const {
return mColor; }
51 virtual void setColor(
const QColor& color ) { mColor = color; }
60 virtual void setFillColor(
const QColor& color ) { Q_UNUSED( color ); }
63 virtual QColor
fillColor()
const {
return QColor(); }
67 virtual QString layerType()
const = 0;
74 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
75 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
77 virtual QString
ogrFeatureStyle(
double mmScaleFactor,
double mapUnitScaleFactor )
const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor );
return QString(); }
106 virtual QSet<QString> usedAttributes()
const;
108 virtual const QgsExpression* dataDefinedProperty(
const QString& property )
const;
109 virtual QString dataDefinedPropertyString(
const QString& property )
const;
110 virtual void setDataDefinedProperty(
const QString& property,
const QString& expressionString );
111 virtual void removeDataDefinedProperty(
const QString& property );
112 virtual void removeDataDefinedProperties();
115 virtual bool writeDxf( QgsDxfExport& e,
116 double mmMapUnitScaleFactor,
117 const QString& layerName,
120 const QPointF& shift = QPointF( 0.0, 0.0 ) )
const;
127 virtual Qt::PenStyle dxfPenStyle()
const;
131 : mType( type ), mLocked( locked ), mRenderingPass( 0 ) {}
141 static const bool selectionIsOpaque =
true;
142 static const bool selectFillBorder =
false;
143 static const bool selectFillStyle =
false;
145 virtual void prepareExpressions(
const QgsVectorLayer* vl,
double scale = -1.0 );
146 virtual QgsExpression* expression(
const QString& property )
const;
148 void saveDataDefinedProperties(
QgsStringMap& stringMap )
const;
180 double angle()
const {
return mAngle; }
183 double size()
const {
return mSize; }
191 virtual void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
193 virtual void writeSldMarker( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const
194 { Q_UNUSED( props ); element.appendChild( doc.createComment( QString(
"QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg(
layerType() ) ) ); }
220 double& offsetX,
double& offsetY )
const;
222 static QPointF _rotatedOffset(
const QPointF& offset,
double angle );
248 virtual void renderPolygonOutline(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );
250 virtual void setWidth(
double width ) { mWidth = width; }
251 virtual double width()
const {
return mWidth; }
270 virtual void renderPolygon(
const QPolygonF& points, QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context ) = 0;
275 double angle()
const {
return mAngle; }
280 void _renderPolygon( QPainter* p,
const QPolygonF& points,
const QList<QPolygonF>* rings,
QgsSymbolV2RenderContext& context );
285 class QgsSymbolLayerV2Widget;