QGIS API Documentation
2.0.1-Dufour
|
#include <qgssinglesymbolrendererv2.h>
Public Member Functions | |
QgsSingleSymbolRendererV2 (QgsSymbolV2 *symbol) | |
virtual | ~QgsSingleSymbolRendererV2 () |
virtual QgsSymbolV2 * | symbolForFeature (QgsFeature &feature) |
to be overridden | |
virtual void | startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer) |
virtual void | stopRender (QgsRenderContext &context) |
virtual QList< QString > | usedAttributes () |
QgsSymbolV2 * | symbol () const |
void | setSymbol (QgsSymbolV2 *s) |
void | setRotationField (QString fieldName) |
QString | rotationField () const |
void | setSizeScaleField (QString fieldName) |
QString | sizeScaleField () const |
void | setScaleMethod (QgsSymbolV2::ScaleMethod scaleMethod) |
QgsSymbolV2::ScaleMethod | scaleMethod () const |
virtual QString | dump () const |
for debugging | |
virtual QgsFeatureRendererV2 * | clone () |
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 () |
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 QgsFeatureRendererV2 * | createFromSld (QDomElement &element, QGis::GeometryType geomType) |
static QgsFeatureRendererV2 * | create (QDomElement &element) |
create renderer from XML element | |
Static Public Member Functions inherited from QgsFeatureRendererV2 | |
static QgsFeatureRendererV2 * | defaultRenderer (QGis::GeometryType geomType) |
return a new renderer - used by default in vector layers | |
static QgsFeatureRendererV2 * | load (QDomElement &symbologyElem) |
create a renderer from XML element | |
static QgsFeatureRendererV2 * | loadSld (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 | |
QgsSymbolV2 * | mSymbol |
QString | mRotationField |
QString | mSizeScaleField |
QgsSymbolV2::ScaleMethod | mScaleMethod |
int | mRotationFieldIdx |
int | mSizeScaleFieldIdx |
QgsSymbolV2 * | mTempSymbol |
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) |
Definition at line 22 of file qgssinglesymbolrendererv2.h.
QgsSingleSymbolRendererV2::QgsSingleSymbolRendererV2 | ( | QgsSymbolV2 * | symbol | ) |
Definition at line 29 of file qgssinglesymbolrendererv2.cpp.
References mSymbol, and symbol().
Referenced by clone(), create(), and createFromSld().
|
virtual |
Definition at line 37 of file qgssinglesymbolrendererv2.cpp.
References mSymbol.
|
inlinevirtual |
returns bitwise OR-ed capabilities of the renderer
Reimplemented from QgsFeatureRendererV2.
Definition at line 65 of file qgssinglesymbolrendererv2.h.
References QgsFeatureRendererV2::RotationField.
|
virtual |
Implements QgsFeatureRendererV2.
Definition at line 188 of file qgssinglesymbolrendererv2.cpp.
References QgsSymbolV2::clone(), mSymbol, QgsSingleSymbolRendererV2(), rotationField(), scaleMethod(), setRotationField(), setScaleMethod(), setSizeScaleField(), QgsFeatureRendererV2::setUsingSymbolLevels(), sizeScaleField(), and QgsFeatureRendererV2::usingSymbolLevels().
|
static |
create renderer from XML element
Definition at line 223 of file qgssinglesymbolrendererv2.cpp.
References QgsSymbolLayerV2Utils::clearSymbolMap(), QgsSymbolLayerV2Utils::decodeScaleMethod(), QgsSymbolLayerV2Utils::loadSymbols(), QgsSingleSymbolRendererV2(), setRotationField(), setScaleMethod(), and setSizeScaleField().
Referenced by QgsRendererV2Registry::QgsRendererV2Registry().
|
static |
Definition at line 254 of file qgssinglesymbolrendererv2.cpp.
References QgsSymbolLayerV2Utils::createSymbolLayerV2ListFromSld(), QGis::Line, QGis::Point, QGis::Polygon, QgsDebugMsg, QgsSingleSymbolRendererV2(), and symbol().
Referenced by QgsRendererV2Registry::QgsRendererV2Registry().
|
virtual |
for debugging
Reimplemented from QgsFeatureRendererV2.
Definition at line 176 of file qgssinglesymbolrendererv2.cpp.
References QgsSymbolV2::dump(), and mSymbol.
|
virtual |
return a list of item text / symbol
Reimplemented from QgsFeatureRendererV2.
Definition at line 376 of file qgssinglesymbolrendererv2.cpp.
References mSymbol.
|
virtual |
return a list of symbology items for the legend
Reimplemented from QgsFeatureRendererV2.
Definition at line 365 of file qgssinglesymbolrendererv2.cpp.
References mSymbol, and QgsSymbolLayerV2Utils::symbolPreviewPixmap().
|
inlinevirtual |
Reimplemented from QgsFeatureRendererV2.
Definition at line 44 of file qgssinglesymbolrendererv2.h.
Referenced by clone().
|
virtual |
store renderer info to XML element
Reimplemented from QgsFeatureRendererV2.
Definition at line 342 of file qgssinglesymbolrendererv2.cpp.
References QgsSymbolLayerV2Utils::encodeScaleMethod(), mRotationField, mScaleMethod, mSizeScaleField, mSymbol, QgsFeatureRendererV2::mUsingSymbolLevels, RENDERER_TAG_NAME, QgsSymbolLayerV2Utils::saveSymbols(), and symbols().
|
inline |
Definition at line 54 of file qgssinglesymbolrendererv2.h.
Referenced by clone(), and setScaleMethod().
|
inlinevirtual |
Reimplemented from QgsFeatureRendererV2.
Definition at line 42 of file qgssinglesymbolrendererv2.h.
void QgsSingleSymbolRendererV2::setScaleMethod | ( | QgsSymbolV2::ScaleMethod | scaleMethod | ) |
Definition at line 170 of file qgssinglesymbolrendererv2.cpp.
References mScaleMethod, mSymbol, scaleMethod(), and QgsFeatureRendererV2::setScaleMethodToSymbol().
|
inline |
Definition at line 47 of file qgssinglesymbolrendererv2.h.
void QgsSingleSymbolRendererV2::setSymbol | ( | QgsSymbolV2 * | s | ) |
Definition at line 163 of file qgssinglesymbolrendererv2.cpp.
References mSymbol.
|
inline |
|
virtual |
Implements QgsFeatureRendererV2.
Definition at line 83 of file qgssinglesymbolrendererv2.cpp.
References QgsSymbolV2::clone(), QgsSymbolV2::DataDefinedRotation, QgsSymbolV2::DataDefinedSizeScale, QgsVectorLayer::fieldNameIndex(), QgsSymbolV2::Line, QgsSymbolV2::Marker, mOrigSize, mRotationField, mRotationFieldIdx, mSizeScaleField, mSizeScaleFieldIdx, mSymbol, mTempSymbol, QgsSymbolV2::setRenderHints(), size, QgsSymbolV2::startRender(), and QgsSymbolV2::type().
Referenced by QgsVectorLayer::drawRendererV2Levels().
|
virtual |
Implements QgsFeatureRendererV2.
Definition at line 123 of file qgssinglesymbolrendererv2.cpp.
References mRotationFieldIdx, mSizeScaleFieldIdx, mSymbol, mTempSymbol, and QgsSymbolV2::stopRender().
Referenced by QgsVectorLayer::stopRendererV2().
QgsSymbolV2 * QgsSingleSymbolRendererV2::symbol | ( | ) | const |
Definition at line 158 of file qgssinglesymbolrendererv2.cpp.
References mSymbol.
Referenced by createFromSld(), QgsVectorLayer::drawRendererV2Levels(), and QgsSingleSymbolRendererV2().
|
virtual |
to be overridden
feature | feature |
Implements QgsFeatureRendererV2.
Definition at line 42 of file qgssinglesymbolrendererv2.cpp.
References QgsFeature::attribute(), QgsSymbolV2::Fill, QgsSymbolV2::Line, QgsSymbolV2::Marker, mOrigSize, mRotationFieldIdx, mScaleMethod, mSizeScaleFieldIdx, mSymbol, mTempSymbol, QgsMarkerSymbolV2::setAngle(), QgsFillSymbolV2::setAngle(), QgsMarkerSymbolV2::setScaleMethod(), QgsMarkerSymbolV2::setSize(), QgsLineSymbolV2::setWidth(), and QgsSymbolV2::type().
|
virtual |
for symbol levels
Implements QgsFeatureRendererV2.
Definition at line 216 of file qgssinglesymbolrendererv2.cpp.
References mSymbol.
Referenced by save().
|
virtual |
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Reimplemented from QgsFeatureRendererV2.
Definition at line 198 of file qgssinglesymbolrendererv2.cpp.
References mRotationField, mSizeScaleField, mSymbol, and QgsSymbolV2::toSld().
|
virtual |
Implements QgsFeatureRendererV2.
Definition at line 140 of file qgssinglesymbolrendererv2.cpp.
References mRotationField, mSizeScaleField, mSymbol, and QgsSymbolV2::usedAttributes().
|
protected |
Definition at line 92 of file qgssinglesymbolrendererv2.h.
Referenced by startRender(), and symbolForFeature().
|
protected |
Definition at line 85 of file qgssinglesymbolrendererv2.h.
Referenced by save(), startRender(), toSld(), and usedAttributes().
|
protected |
Definition at line 90 of file qgssinglesymbolrendererv2.h.
Referenced by startRender(), stopRender(), and symbolForFeature().
|
protected |
Definition at line 87 of file qgssinglesymbolrendererv2.h.
Referenced by save(), setScaleMethod(), and symbolForFeature().
|
protected |
Definition at line 86 of file qgssinglesymbolrendererv2.h.
Referenced by save(), startRender(), toSld(), and usedAttributes().
|
protected |
Definition at line 90 of file qgssinglesymbolrendererv2.h.
Referenced by startRender(), stopRender(), and symbolForFeature().
|
protected |
Definition at line 84 of file qgssinglesymbolrendererv2.h.
Referenced by clone(), dump(), legendSymbolItems(), legendSymbologyItems(), QgsSingleSymbolRendererV2(), save(), setScaleMethod(), setSymbol(), startRender(), stopRender(), symbol(), symbolForFeature(), symbols(), toSld(), usedAttributes(), and ~QgsSingleSymbolRendererV2().
|
protected |
Definition at line 91 of file qgssinglesymbolrendererv2.h.
Referenced by startRender(), stopRender(), and symbolForFeature().