QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsSingleSymbolRendererV2 Class Reference

#include <qgssinglesymbolrendererv2.h>

Inheritance diagram for QgsSingleSymbolRendererV2:
Inheritance graph
[legend]
Collaboration diagram for QgsSingleSymbolRendererV2:
Collaboration graph
[legend]

Public Member Functions

 QgsSingleSymbolRendererV2 (QgsSymbolV2 *symbol)
virtual ~QgsSingleSymbolRendererV2 ()
virtual QgsSymbolV2symbolForFeature (QgsFeature &feature)
 to be overridden
virtual void startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer)
virtual void stopRender (QgsRenderContext &context)
virtual QList< QString > usedAttributes ()
QgsSymbolV2symbol () const
void setSymbol (QgsSymbolV2 *s)
void setRotationField (QString fieldOrExpression)
QString rotationField () const
void setSizeScaleField (QString fieldOrExpression)
QString sizeScaleField () const
void setScaleMethod (QgsSymbolV2::ScaleMethod scaleMethod)
QgsSymbolV2::ScaleMethod scaleMethod () const
virtual QString dump () const
 for debugging
virtual QgsFeatureRendererV2clone ()
virtual void toSld (QDomDocument &doc, QDomElement &element) const
 used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual int capabilities ()
 returns bitwise OR-ed capabilities of the renderer
virtual QgsSymbolV2List symbols ()
 for symbol levels
virtual QDomElement save (QDomDocument &doc)
 store renderer info to XML element
virtual QgsLegendSymbologyList legendSymbologyItems (QSize iconSize)
 return a list of symbology items for the legend
virtual QgsLegendSymbolList legendSymbolItems (double scaleDenominator=-1, QString rule=QString())
 return a list of item text / symbol
- Public Member Functions inherited from QgsFeatureRendererV2
QString type () const
virtual ~QgsFeatureRendererV2 ()
virtual bool renderFeature (QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
bool usingSymbolLevels () const
void setUsingSymbolLevels (bool usingSymbolLevels)
virtual QDomElement writeSld (QDomDocument &doc, const QgsVectorLayer &layer) const
 create the SLD UserStyle element following the SLD v1.1 specs
void setVertexMarkerAppearance (int type, int size)
 set type and size of editing vertex markers for subsequent rendering
virtual bool willRenderFeature (QgsFeature &feat)
 return whether the renderer will render a feature or not.
virtual QgsSymbolV2List symbolsForFeature (QgsFeature &feat)
 return list of symbols used for rendering the feature.

Static Public Member Functions

static QgsFeatureRendererV2createFromSld (QDomElement &element, QGis::GeometryType geomType)
static QgsFeatureRendererV2create (QDomElement &element)
 create renderer from XML element
- Static Public Member Functions inherited from QgsFeatureRendererV2
static QgsFeatureRendererV2defaultRenderer (QGis::GeometryType geomType)
 return a new renderer - used by default in vector layers
static QgsFeatureRendererV2load (QDomElement &symbologyElem)
 create a renderer from XML element
static QgsFeatureRendererV2loadSld (const QDomNode &node, QGis::GeometryType geomType, QString &errorMessage)
 create a new renderer according to the information contained in the UserStyle element of a SLD style document

Protected Attributes

QScopedPointer< QgsSymbolV2mSymbol
QScopedPointer< QgsExpressionmRotation
QScopedPointer< QgsExpressionmSizeScale
QgsSymbolV2::ScaleMethod mScaleMethod
QScopedPointer< QgsSymbolV2mTempSymbol
double mOrigSize
- Protected Attributes inherited from QgsFeatureRendererV2
QString mType
bool mUsingSymbolLevels
int mCurrentVertexMarkerType
 The current type of editing marker.
int mCurrentVertexMarkerSize
 The current size of editing marker.

Additional Inherited Members

- Public Types inherited from QgsFeatureRendererV2
enum  Capabilities {
  SymbolLevels = 1, RotationField = 1 << 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3,
  ScaleDependent = 1 << 4
}
- Protected Member Functions inherited from QgsFeatureRendererV2
 QgsFeatureRendererV2 (QString type)
void renderFeatureWithSymbol (QgsFeature &feature, QgsSymbolV2 *symbol, QgsRenderContext &context, int layer, bool selected, bool drawVertexMarker)
void renderVertexMarker (QPointF &pt, QgsRenderContext &context)
 render editing vertex marker at specified point
void renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context)
 render editing vertex marker for a polyline
void renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context)
 render editing vertex marker for a polygon
void setScaleMethodToSymbol (QgsSymbolV2 *symbol, int scaleMethod)
- Static Protected Member Functions inherited from QgsFeatureRendererV2
static const unsigned char * _getPoint (QPointF &pt, QgsRenderContext &context, const unsigned char *wkb)
static const unsigned char * _getLineString (QPolygonF &pts, QgsRenderContext &context, const unsigned char *wkb)
static const unsigned char * _getPolygon (QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, const unsigned char *wkb)

Detailed Description

Definition at line 24 of file qgssinglesymbolrendererv2.h.

Constructor & Destructor Documentation

QgsSingleSymbolRendererV2::QgsSingleSymbolRendererV2 ( QgsSymbolV2 symbol)

Definition at line 30 of file qgssinglesymbolrendererv2.cpp.

Referenced by clone(), create(), and createFromSld().

QgsSingleSymbolRendererV2::~QgsSingleSymbolRendererV2 ( )
virtual

Definition at line 38 of file qgssinglesymbolrendererv2.cpp.

Member Function Documentation

virtual int QgsSingleSymbolRendererV2::capabilities ( )
inlinevirtual

returns bitwise OR-ed capabilities of the renderer

Note
added in 2.0

Reimplemented from QgsFeatureRendererV2.

Definition at line 67 of file qgssinglesymbolrendererv2.h.

References QgsFeatureRendererV2::RotationField.

QgsFeatureRendererV2 * QgsSingleSymbolRendererV2::clone ( )
virtual
QgsFeatureRendererV2 * QgsSingleSymbolRendererV2::create ( QDomElement &  element)
static
QgsFeatureRendererV2 * QgsSingleSymbolRendererV2::createFromSld ( QDomElement &  element,
QGis::GeometryType  geomType 
)
static
QString QgsSingleSymbolRendererV2::dump ( ) const
virtual

for debugging

Reimplemented from QgsFeatureRendererV2.

Definition at line 165 of file qgssinglesymbolrendererv2.cpp.

References mSymbol.

QgsLegendSymbolList QgsSingleSymbolRendererV2::legendSymbolItems ( double  scaleDenominator = -1,
QString  rule = QString() 
)
virtual

return a list of item text / symbol

Note
: this method was added in version 1.5
not available in python bindings

Reimplemented from QgsFeatureRendererV2.

Definition at line 361 of file qgssinglesymbolrendererv2.cpp.

References mSymbol.

QgsLegendSymbologyList QgsSingleSymbolRendererV2::legendSymbologyItems ( QSize  iconSize)
virtual

return a list of symbology items for the legend

Reimplemented from QgsFeatureRendererV2.

Definition at line 350 of file qgssinglesymbolrendererv2.cpp.

References mSymbol, and QgsSymbolLayerV2Utils::symbolPreviewPixmap().

QString QgsSingleSymbolRendererV2::rotationField ( ) const
virtual
Note
added in 1.5

Reimplemented from QgsFeatureRendererV2.

Definition at line 144 of file qgssinglesymbolrendererv2.cpp.

References QgsSymbolLayerV2Utils::fieldOrExpressionFromExpression(), and mRotation.

Referenced by clone().

QDomElement QgsSingleSymbolRendererV2::save ( QDomDocument &  doc)
virtual
QgsSymbolV2::ScaleMethod QgsSingleSymbolRendererV2::scaleMethod ( ) const
inline
Note
added in 2.0

Definition at line 56 of file qgssinglesymbolrendererv2.h.

Referenced by clone(), and setScaleMethod().

void QgsSingleSymbolRendererV2::setRotationField ( QString  fieldOrExpression)
virtual
Note
added in 1.5

Reimplemented from QgsFeatureRendererV2.

Definition at line 139 of file qgssinglesymbolrendererv2.cpp.

References QgsSymbolLayerV2Utils::fieldOrExpressionToExpression(), and mRotation.

Referenced by clone(), and create().

void QgsSingleSymbolRendererV2::setScaleMethod ( QgsSymbolV2::ScaleMethod  scaleMethod)
Note
added in 2.0

Definition at line 159 of file qgssinglesymbolrendererv2.cpp.

References mScaleMethod, mSymbol, scaleMethod(), and QgsFeatureRendererV2::setScaleMethodToSymbol().

Referenced by clone(), and create().

void QgsSingleSymbolRendererV2::setSizeScaleField ( QString  fieldOrExpression)
Note
added in 1.5

Definition at line 149 of file qgssinglesymbolrendererv2.cpp.

References QgsSymbolLayerV2Utils::fieldOrExpressionToExpression(), and mSizeScale.

Referenced by clone(), and create().

void QgsSingleSymbolRendererV2::setSymbol ( QgsSymbolV2 s)

Definition at line 133 of file qgssinglesymbolrendererv2.cpp.

References mSymbol.

QString QgsSingleSymbolRendererV2::sizeScaleField ( ) const
Note
added in 1.5

Definition at line 154 of file qgssinglesymbolrendererv2.cpp.

References QgsSymbolLayerV2Utils::fieldOrExpressionFromExpression(), and mSizeScale.

Referenced by clone().

void QgsSingleSymbolRendererV2::startRender ( QgsRenderContext context,
const QgsVectorLayer vlayer 
)
virtual
void QgsSingleSymbolRendererV2::stopRender ( QgsRenderContext context)
virtual

Implements QgsFeatureRendererV2.

Definition at line 105 of file qgssinglesymbolrendererv2.cpp.

References mRotation, mSizeScale, mSymbol, and mTempSymbol.

Referenced by QgsVectorLayer::stopRendererV2().

QgsSymbolV2 * QgsSingleSymbolRendererV2::symbol ( ) const

Definition at line 128 of file qgssinglesymbolrendererv2.cpp.

References mSymbol.

Referenced by createFromSld(), and QgsVectorLayer::drawRendererV2Levels().

QgsSymbolV2 * QgsSingleSymbolRendererV2::symbolForFeature ( QgsFeature feature)
virtual
QgsSymbolV2List QgsSingleSymbolRendererV2::symbols ( )
virtual

for symbol levels

Implements QgsFeatureRendererV2.

Definition at line 199 of file qgssinglesymbolrendererv2.cpp.

References mSymbol.

Referenced by save().

void QgsSingleSymbolRendererV2::toSld ( QDomDocument &  doc,
QDomElement &  element 
) const
virtual

used from subclasses to create SLD Rule elements following SLD v1.1 specs

Note
added in 1.9

Reimplemented from QgsFeatureRendererV2.

Definition at line 180 of file qgssinglesymbolrendererv2.cpp.

References mRotation, mSizeScale, and mSymbol.

QList< QString > QgsSingleSymbolRendererV2::usedAttributes ( )
virtual

Implements QgsFeatureRendererV2.

Definition at line 119 of file qgssinglesymbolrendererv2.cpp.

References mRotation, mSizeScale, and mSymbol.

Member Data Documentation

double QgsSingleSymbolRendererV2::mOrigSize
protected

Definition at line 93 of file qgssinglesymbolrendererv2.h.

Referenced by startRender(), and symbolForFeature().

QScopedPointer<QgsExpression> QgsSingleSymbolRendererV2::mRotation
protected
QgsSymbolV2::ScaleMethod QgsSingleSymbolRendererV2::mScaleMethod
protected

Definition at line 89 of file qgssinglesymbolrendererv2.h.

Referenced by save(), setScaleMethod(), and symbolForFeature().

QScopedPointer<QgsExpression> QgsSingleSymbolRendererV2::mSizeScale
protected
QScopedPointer<QgsSymbolV2> QgsSingleSymbolRendererV2::mSymbol
protected
QScopedPointer<QgsSymbolV2> QgsSingleSymbolRendererV2::mTempSymbol
protected

Definition at line 92 of file qgssinglesymbolrendererv2.h.

Referenced by startRender(), stopRender(), and symbolForFeature().


The documentation for this class was generated from the following files: