QGIS API Documentation
2.2.0-Valmiera
|
#include <qgssymbolv2.h>
Public Types | |
enum | OutputUnit { MM = 0, MapUnit, Mixed } |
enum | SymbolType { Marker, Line, Fill } |
enum | ScaleMethod { ScaleArea, ScaleDiameter } |
enum | RenderHint { DataDefinedSizeScale = 1, DataDefinedRotation = 2 } |
Public Member Functions | |
virtual | ~QgsSymbolV2 () |
SymbolType | type () const |
QgsSymbolLayerV2 * | symbolLayer (int layer) |
int | symbolLayerCount () |
bool | insertSymbolLayer (int index, QgsSymbolLayerV2 *layer) |
insert symbol layer to specified index | |
bool | appendSymbolLayer (QgsSymbolLayerV2 *layer) |
append symbol layer at the end of the list | |
bool | deleteSymbolLayer (int index) |
delete symbol layer at specified index | |
QgsSymbolLayerV2 * | takeSymbolLayer (int index) |
remove symbol layer from the list and return pointer to it | |
bool | changeSymbolLayer (int index, QgsSymbolLayerV2 *layer) |
delete layer at specified index and set a new one | |
void | startRender (QgsRenderContext &context, const QgsVectorLayer *layer=0) |
void | stopRender (QgsRenderContext &context) |
void | setColor (const QColor &color) |
QColor | color () const |
void | drawPreviewIcon (QPainter *painter, QSize size) |
QImage | bigSymbolPreviewImage () |
QString | dump () const |
virtual QgsSymbolV2 * | clone () const =0 |
void | toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const |
QgsSymbolV2::OutputUnit | outputUnit () const |
void | setOutputUnit (QgsSymbolV2::OutputUnit u) |
qreal | alpha () const |
Get alpha transparency 1 for opaque, 0 for invisible. | |
void | setAlpha (qreal alpha) |
Set alpha transparency 1 for opaque, 0 for invisible. | |
void | setRenderHints (int hints) |
int | renderHints () const |
QSet< QString > | usedAttributes () const |
void | setLayer (const QgsVectorLayer *layer) |
const QgsVectorLayer * | layer () const |
Static Public Member Functions | |
static QgsSymbolV2 * | defaultSymbol (QGis::GeometryType geomType) |
return new default symbol for specified geometry type |
Protected Member Functions | |
QgsSymbolV2 (SymbolType type, QgsSymbolLayerV2List layers) | |
QgsSymbolLayerV2List | cloneLayers () const |
bool | isSymbolLayerCompatible (SymbolType t) |
check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line) |
Protected Attributes | |
SymbolType | mType |
QgsSymbolLayerV2List | mLayers |
qreal | mAlpha |
Symbol opacity (in the range 0 - 1) | |
int | mRenderHints |
const QgsVectorLayer * | mLayer |
Definition at line 41 of file qgssymbolv2.h.
Definition at line 45 of file qgssymbolv2.h.
Definition at line 66 of file qgssymbolv2.h.
Definition at line 59 of file qgssymbolv2.h.
Definition at line 52 of file qgssymbolv2.h.
|
virtual |
Definition at line 56 of file qgssymbolv2.cpp.
References mLayers.
|
protected |
Definition at line 36 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and type().
|
inline |
Get alpha transparency 1 for opaque, 0 for invisible.
Definition at line 120 of file qgssymbolv2.h.
Referenced by QgsSymbolLayerV2Utils::saveSymbol(), and toSld().
bool QgsSymbolV2::appendSymbolLayer | ( | QgsSymbolLayerV2 * | layer | ) |
append symbol layer at the end of the list
Definition at line 173 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and QgsSymbolLayerV2::type().
QImage QgsSymbolV2::bigSymbolPreviewImage | ( | ) |
Definition at line 284 of file qgssymbolv2.cpp.
References QgsSymbolLayerV2Utils::createRenderContext(), Fill, Line, Marker, mType, startRender(), and stopRender().
bool QgsSymbolV2::changeSymbolLayer | ( | int | index, |
QgsSymbolLayerV2 * | layer | ||
) |
delete layer at specified index and set a new one
Definition at line 203 of file qgssymbolv2.cpp.
References index, isSymbolLayerCompatible(), layer(), mLayers, and QgsSymbolLayerV2::type().
|
pure virtual |
Implemented in QgsFillSymbolV2, QgsLineSymbolV2, and QgsMarkerSymbolV2.
Referenced by QgsGraduatedSymbolRendererV2::addClass(), QgsComposerSymbolV2Item::clone(), QgsRuleBasedRendererV2::Rule::clone(), QgsGraduatedSymbolRendererV2::createRenderer(), QgsRuleBasedRendererV2::refineRuleCategories(), QgsRuleBasedRendererV2::refineRuleRanges(), QgsRuleBasedRendererV2::refineRuleScales(), QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), QgsStyleV2::symbol(), QgsGraduatedSymbolRendererV2::updateColorRamp(), QgsCategorizedSymbolRendererV2::updateSymbols(), and QgsGraduatedSymbolRendererV2::updateSymbols().
|
protected |
Definition at line 357 of file qgssymbolv2.cpp.
References layer(), mLayers, QgsSymbolLayerV2::setLocked(), and QgsSymbolLayerV2::setRenderingPass().
Referenced by QgsMarkerSymbolV2::clone(), QgsLineSymbolV2::clone(), and QgsFillSymbolV2::clone().
QColor QgsSymbolV2::color | ( | void | ) | const |
Definition at line 247 of file qgssymbolv2.cpp.
References mLayers.
Referenced by dump(), QgsImageFillSymbolLayer::dxfColor(), QgsComposerMap::gridPen(), QgsMarkerLineSymbolLayerV2::setSubSymbol(), QgsCentroidFillSymbolLayerV2::setSubSymbol(), QgsCategorizedSymbolRendererV2::updateSymbols(), and QgsGraduatedSymbolRendererV2::updateSymbols().
|
static |
return new default symbol for specified geometry type
Definition at line 95 of file qgssymbolv2.cpp.
References QgsStyleV2::defaultStyle(), QgsProject::instance(), QGis::Line, QGis::Point, QGis::Polygon, QgsDebugMsg, QgsProject::readEntry(), setAlpha(), setColor(), and QgsStyleV2::symbol().
Referenced by QgsFeatureRendererV2::defaultRenderer(), and QgsVectorLayer::drawRendererV2Levels().
bool QgsSymbolV2::deleteSymbolLayer | ( | int | index | ) |
delete symbol layer at specified index
Definition at line 183 of file qgssymbolv2.cpp.
void QgsSymbolV2::drawPreviewIcon | ( | QPainter * | painter, |
QSize | size | ||
) |
Definition at line 258 of file qgssymbolv2.cpp.
References QgsSymbolLayerV2Utils::createRenderContext(), Fill, Line, mAlpha, mLayer, mLayers, mRenderHints, mType, outputUnit(), QgsLineSymbolLayerV2::renderPolygonOutline(), QgsSymbolV2RenderContext::setLayer(), QgsSymbolLayerV2::startRender(), and QgsSymbolLayerV2::stopRender().
Referenced by QgsVectorFieldSymbolLayer::drawPreviewIcon(), QgsComposerLegend::drawSymbolV2(), and QgsSymbolLayerV2Utils::symbolPreviewPixmap().
QString QgsSymbolV2::dump | ( | ) | const |
Definition at line 325 of file qgssymbolv2.cpp.
References color(), QgsSymbolLayerV2Utils::encodeColor(), Fill, Line, Marker, mLayers, and type().
bool QgsSymbolV2::insertSymbolLayer | ( | int | index, |
QgsSymbolLayerV2 * | layer | ||
) |
insert symbol layer to specified index
Definition at line 161 of file qgssymbolv2.cpp.
References isSymbolLayerCompatible(), mLayers, and QgsSymbolLayerV2::type().
|
protected |
check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line)
Definition at line 151 of file qgssymbolv2.cpp.
References Fill, Line, and mType.
Referenced by appendSymbolLayer(), changeSymbolLayer(), insertSymbolLayer(), and QgsSymbolV2().
|
inline |
Definition at line 132 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::angle(), changeSymbolLayer(), cloneLayers(), QgsMarkerSymbolV2::renderPoint(), QgsLineSymbolV2::renderPolyline(), QgsMarkerSymbolV2::scaleMethod(), QgsMarkerSymbolV2::setAngle(), QgsFillSymbolV2::setAngle(), QgsMarkerSymbolV2::setScaleMethod(), QgsMarkerSymbolV2::setSize(), QgsLineSymbolV2::setWidth(), QgsMarkerSymbolV2::size(), startRender(), symbolLayer(), and QgsLineSymbolV2::width().
QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit | ( | ) | const |
Definition at line 63 of file qgssymbolv2.cpp.
References Mixed, and mLayers.
Referenced by drawPreviewIcon(), QgsComposerLegend::drawSymbolV2(), QgsCentroidFillSymbolLayerV2::outputUnit(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), stopRender(), and toSld().
|
inline |
Definition at line 127 of file qgssymbolv2.h.
|
inline |
Set alpha transparency 1 for opaque, 0 for invisible.
Definition at line 122 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::clone(), QgsLineSymbolV2::clone(), QgsFillSymbolV2::clone(), QgsComposerMap::createDefaultOverviewFrameSymbol(), defaultSymbol(), QgsSymbolLayerV2Utils::loadSymbol(), QgsMarkerLineSymbolLayerV2::startRender(), and QgsCentroidFillSymbolLayerV2::startRender().
void QgsSymbolV2::setColor | ( | const QColor & | color | ) |
Definition at line 238 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsGraduatedSymbolRendererV2::createRenderer(), defaultSymbol(), QgsVectorLayer::drawRendererV2Levels(), QgsComposerMap::readXML(), QgsMarkerLineSymbolLayerV2::setColor(), QgsLinePatternFillSymbolLayer::setColor(), QgsCentroidFillSymbolLayerV2::setColor(), QgsComposerMap::setGridPenColor(), QgsGraduatedSymbolRendererV2::updateColorRamp(), QgsCategorizedSymbolRendererV2::updateSymbols(), and QgsGraduatedSymbolRendererV2::updateSymbols().
|
inline |
Definition at line 131 of file qgssymbolv2.h.
void QgsSymbolV2::setOutputUnit | ( | QgsSymbolV2::OutputUnit | u | ) |
Definition at line 86 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsComposerLegend::drawSymbolV2(), and QgsSymbolLayerV2Utils::loadSymbol().
|
inline |
Definition at line 125 of file qgssymbolv2.h.
Referenced by QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), and QgsMarkerLineSymbolLayerV2::startRender().
void QgsSymbolV2::startRender | ( | QgsRenderContext & | context, |
const QgsVectorLayer * | layer = 0 |
||
) |
Definition at line 216 of file qgssymbolv2.cpp.
References layer(), mAlpha, mLayer, mLayers, mRenderHints, outputUnit(), and QgsSymbolV2RenderContext::setLayer().
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), bigSymbolPreviewImage(), QgsComposerMap::drawGridLine(), QgsAnnotationItem::drawMarkerSymbol(), QgsComposerMap::drawOverviewMapExtent(), QgsComposerShape::drawShapeUsingSymbol(), QgsPaperItem::paint(), QgsPointDisplacementRenderer::startRender(), QgsVectorFieldSymbolLayer::startRender(), QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), QgsMarkerLineSymbolLayerV2::startRender(), QgsSVGFillSymbolLayer::startRender(), QgsLinePatternFillSymbolLayer::startRender(), QgsPointPatternFillSymbolLayer::startRender(), and QgsCentroidFillSymbolLayerV2::startRender().
void QgsSymbolV2::stopRender | ( | QgsRenderContext & | context | ) |
Definition at line 227 of file qgssymbolv2.cpp.
References mAlpha, mLayer, mLayers, mRenderHints, outputUnit(), and QgsSymbolV2RenderContext::setLayer().
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), bigSymbolPreviewImage(), QgsComposerMap::drawGridLine(), QgsAnnotationItem::drawMarkerSymbol(), QgsComposerMap::drawOverviewMapExtent(), QgsComposerShape::drawShapeUsingSymbol(), QgsPaperItem::paint(), QgsPointDisplacementRenderer::stopRender(), QgsVectorFieldSymbolLayer::stopRender(), QgsMarkerLineSymbolLayerV2::stopRender(), QgsSVGFillSymbolLayer::stopRender(), QgsPointPatternFillSymbolLayer::stopRender(), and QgsCentroidFillSymbolLayerV2::stopRender().
QgsSymbolLayerV2 * QgsSymbolV2::symbolLayer | ( | int | layer | ) |
Definition at line 142 of file qgssymbolv2.cpp.
References layer(), and mLayers.
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsVectorLayer::drawRendererV2Levels(), QgsImageFillSymbolLayer::estimateMaxBleed(), QgsSymbolLayerV2Utils::estimateMaxSymbolBleed(), QgsVectorFileWriter::exportFeaturesSymbolLevels(), QgsSymbolLayerV2Utils::loadSymbols(), QgsSymbolLayerV2Utils::saveSymbol(), QgsHighlight::setSymbolColor(), QgsRuleBasedRendererV2::stopRender(), QgsMarkerLineSymbolLayerV2::toSld(), and QgsPointPatternFillSymbolLayer::toSld().
|
inline |
Definition at line 83 of file qgssymbolv2.h.
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsVectorLayer::drawRendererV2Levels(), QgsSymbolLayerV2Utils::estimateMaxSymbolBleed(), QgsVectorFileWriter::exportFeaturesSymbolLevels(), QgsSymbolLayerV2Utils::loadSymbols(), QgsSymbolLayerV2Utils::saveSymbol(), QgsHighlight::setSymbolColor(), QgsRuleBasedRendererV2::stopRender(), QgsMarkerLineSymbolLayerV2::toSld(), and QgsPointPatternFillSymbolLayer::toSld().
QgsSymbolLayerV2 * QgsSymbolV2::takeSymbolLayer | ( | int | index | ) |
remove symbol layer from the list and return pointer to it
Definition at line 194 of file qgssymbolv2.cpp.
References mLayers.
void QgsSymbolV2::toSld | ( | QDomDocument & | doc, |
QDomElement & | element, | ||
QgsStringMap | props | ||
) | const |
Definition at line 344 of file qgssymbolv2.cpp.
References alpha(), QgsSymbolLayerV2Utils::encodeSldUom(), mLayers, and outputUnit().
Referenced by QgsVectorFieldSymbolLayer::toSld(), QgsSVGFillSymbolLayer::toSld(), QgsLinePatternFillSymbolLayer::toSld(), and QgsCentroidFillSymbolLayerV2::toSld().
|
inline |
Definition at line 77 of file qgssymbolv2.h.
Referenced by dump(), QgsSymbolV2(), QgsFeatureRendererV2::renderFeatureWithSymbol(), QgsSymbolLayerV2Utils::saveSymbol(), QgsFeatureRendererV2::setScaleMethodToSymbol(), QgsVectorFieldSymbolLayer::setSubSymbol(), QgsMarkerLineSymbolLayerV2::setSubSymbol(), QgsImageFillSymbolLayer::setSubSymbol(), QgsLinePatternFillSymbolLayer::setSubSymbol(), QgsPointPatternFillSymbolLayer::setSubSymbol(), QgsCentroidFillSymbolLayerV2::setSubSymbol(), QgsGraduatedSymbolRendererV2::symbolForFeature(), and QgsCategorizedSymbolRendererV2::symbolForFeature().
QSet< QString > QgsSymbolV2::usedAttributes | ( | ) | const |
Definition at line 370 of file qgssymbolv2.cpp.
References mLayers.
Referenced by QgsGraduatedSymbolRendererV2::usedAttributes(), QgsCategorizedSymbolRendererV2::usedAttributes(), QgsPointPatternFillSymbolLayer::usedAttributes(), and QgsCentroidFillSymbolLayerV2::usedAttributes().
|
protected |
Symbol opacity (in the range 0 - 1)
Definition at line 148 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::clone(), QgsLineSymbolV2::clone(), QgsFillSymbolV2::clone(), drawPreviewIcon(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), and stopRender().
|
protected |
Definition at line 152 of file qgssymbolv2.h.
Referenced by drawPreviewIcon(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), and stopRender().
|
protected |
Definition at line 145 of file qgssymbolv2.h.
Referenced by QgsMarkerSymbolV2::angle(), appendSymbolLayer(), changeSymbolLayer(), cloneLayers(), color(), deleteSymbolLayer(), drawPreviewIcon(), dump(), insertSymbolLayer(), outputUnit(), QgsFillSymbolV2::QgsFillSymbolV2(), QgsLineSymbolV2::QgsLineSymbolV2(), QgsMarkerSymbolV2::QgsMarkerSymbolV2(), QgsSymbolV2(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), QgsMarkerSymbolV2::scaleMethod(), QgsMarkerSymbolV2::setAngle(), QgsFillSymbolV2::setAngle(), setColor(), setOutputUnit(), QgsMarkerSymbolV2::setScaleMethod(), QgsMarkerSymbolV2::setSize(), QgsLineSymbolV2::setWidth(), QgsMarkerSymbolV2::size(), startRender(), stopRender(), symbolLayer(), takeSymbolLayer(), toSld(), usedAttributes(), QgsLineSymbolV2::width(), and ~QgsSymbolV2().
|
protected |
Definition at line 150 of file qgssymbolv2.h.
Referenced by drawPreviewIcon(), QgsMarkerSymbolV2::renderPoint(), QgsFillSymbolV2::renderPolygon(), QgsLineSymbolV2::renderPolyline(), startRender(), and stopRender().
|
protected |
Definition at line 144 of file qgssymbolv2.h.
Referenced by bigSymbolPreviewImage(), drawPreviewIcon(), and isSymbolLayerCompatible().