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

#include <qgssymbolv2.h>

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

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
QgsSymbolLayerV2symbolLayer (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
QgsSymbolLayerV2takeSymbolLayer (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 QgsSymbolV2clone () 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 QgsVectorLayerlayer () const

Static Public Member Functions

static QgsSymbolV2defaultSymbol (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 QgsVectorLayermLayer

Detailed Description

Definition at line 41 of file qgssymbolv2.h.

Member Enumeration Documentation

Enumerator:
MM 
MapUnit 
Mixed 

Definition at line 45 of file qgssymbolv2.h.

Note
added in 1.5
Enumerator:
DataDefinedSizeScale 
DataDefinedRotation 

Definition at line 66 of file qgssymbolv2.h.

Enumerator:
ScaleArea 
ScaleDiameter 

Definition at line 59 of file qgssymbolv2.h.

Enumerator:
Marker 
Line 
Fill 

Definition at line 52 of file qgssymbolv2.h.

Constructor & Destructor Documentation

QgsSymbolV2::~QgsSymbolV2 ( )
virtual

Definition at line 56 of file qgssymbolv2.cpp.

References mLayers.

QgsSymbolV2::QgsSymbolV2 ( SymbolType  type,
QgsSymbolLayerV2List  layers 
)
protected

Definition at line 36 of file qgssymbolv2.cpp.

References isSymbolLayerCompatible(), mLayers, and type().

Member Function Documentation

qreal QgsSymbolV2::alpha ( ) const
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 ( )
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().

virtual QgsSymbolV2* QgsSymbolV2::clone ( ) const
pure virtual
QgsSymbolLayerV2List QgsSymbolV2::cloneLayers ( ) const
protected
QColor QgsSymbolV2::color ( void  ) const
QgsSymbolV2 * QgsSymbolV2::defaultSymbol ( QGis::GeometryType  geomType)
static
bool QgsSymbolV2::deleteSymbolLayer ( int  index)

delete symbol layer at specified index

Definition at line 183 of file qgssymbolv2.cpp.

References index, and mLayers.

void QgsSymbolV2::drawPreviewIcon ( QPainter *  painter,
QSize  size 
)
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().

bool QgsSymbolV2::isSymbolLayerCompatible ( SymbolType  t)
protected

check whether a symbol layer type can be used within the symbol (marker-marker, line-line, fill-fill/line)

Note
added in 1.7

Definition at line 151 of file qgssymbolv2.cpp.

References Fill, Line, and mType.

Referenced by appendSymbolLayer(), changeSymbolLayer(), insertSymbolLayer(), and QgsSymbolV2().

const QgsVectorLayer* QgsSymbolV2::layer ( ) const
inline
QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit ( ) const
int QgsSymbolV2::renderHints ( ) const
inline
Note
added in 1.5

Definition at line 127 of file qgssymbolv2.h.

void QgsSymbolV2::setAlpha ( qreal  alpha)
inline
void QgsSymbolV2::setColor ( const QColor &  color)
void QgsSymbolV2::setLayer ( const QgsVectorLayer layer)
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().

void QgsSymbolV2::setRenderHints ( int  hints)
inline
void QgsSymbolV2::startRender ( QgsRenderContext context,
const QgsVectorLayer layer = 0 
)
void QgsSymbolV2::stopRender ( QgsRenderContext context)
QgsSymbolLayerV2 * QgsSymbolV2::symbolLayer ( int  layer)
int QgsSymbolV2::symbolLayerCount ( )
inline
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
SymbolType QgsSymbolV2::type ( ) const
inline
QSet< QString > QgsSymbolV2::usedAttributes ( ) const

Member Data Documentation

qreal QgsSymbolV2::mAlpha
protected
const QgsVectorLayer* QgsSymbolV2::mLayer
protected
QgsSymbolLayerV2List QgsSymbolV2::mLayers
protected
int QgsSymbolV2::mRenderHints
protected
SymbolType QgsSymbolV2::mType
protected

Definition at line 144 of file qgssymbolv2.h.

Referenced by bigSymbolPreviewImage(), drawPreviewIcon(), and isSymbolLayerCompatible().


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