Skip to content
Permalink
Browse files

* update QgsSymbolV2 sip bindings

* fix a crash when setRotationField (now deprecated) is used on a fresh
  QgsCategorizedSymbolRendererV2
  • Loading branch information
jef-n committed Aug 13, 2015
1 parent 40500d6 commit ac89dc0e73fe907e6e16a555a432c080a574c0be
@@ -239,18 +239,48 @@ class QgsMarkerSymbolV2 : QgsSymbolV2
QgsMarkerSymbolV2( QgsSymbolLayerV2List layers /Transfer/ = QgsSymbolLayerV2List() );

void setAngle( double angle );
double angle();
double angle() const;

/** Set data defined angle for whole symbol (including all symbol layers).
* @param dd data defined angle
* @note added in QGIS 2.9
* @see dataDefinedAngle
*/
void setDataDefinedAngle( const QgsDataDefined& dd );

/** Returns data defined angle for whole symbol (including all symbol layers).
* @returns data defined angle, or empty data defined if angle is not set
* at the marker level
* @note added in QGIS 2.9
* @see setDataDefinedAngle
*/
QgsDataDefined dataDefinedAngle() const;

/** Sets the line angle modification for the symbol's angle. This angle is added to
* the marker's rotation and data defined rotation before rendering the symbol, and
* is usually used for orienting symbols to match a line's angle.
* @param lineangle Angle in degrees, valid values are between 0 and 360
* @param lineAngle Angle in degrees, valid values are between 0 and 360
* @note added in QGIS 2.9
*/
void setLineAngle( double lineAngle );

void setSize( double size );
double size();
double size() const;

/** Set data defined size for whole symbol (including all symbol layers).
* @param dd data defined size
* @note added in QGIS 2.9
* @see dataDefinedSize
*/
void setDataDefinedSize( const QgsDataDefined& dd );

/** Returns data defined size for whole symbol (including all symbol layers).
* @returns data defined size, or empty data defined if size is not set
* at the marker level
* @note added in QGIS 2.9
* @see setDataDefinedSize
*/
QgsDataDefined dataDefinedSize() const;

void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod );
ScaleMethod scaleMethod();
@@ -277,7 +307,22 @@ class QgsLineSymbolV2 : QgsSymbolV2
QgsLineSymbolV2( QgsSymbolLayerV2List layers /Transfer/ = QgsSymbolLayerV2List() );

void setWidth( double width );
double width();
double width() const;

/** Set data defined width for whole symbol (including all symbol layers).
* @param dd data defined width
* @note added in QGIS 2.9
* @see dataDefinedWidth
*/
void setDataDefinedWidth( const QgsDataDefined& dd );

/** Returns data defined size for whole symbol (including all symbol layers).
* @returns data defined size, or empty data defined if size is not set
* at the line level
* @note added in QGIS 2.9
* @see setDataDefinedWidth
*/
QgsDataDefined dataDefinedWidth() const;

void renderPolyline( const QPolygonF& points, const QgsFeature* f, QgsRenderContext& context, int layer = -1, bool selected = false );

@@ -299,7 +344,6 @@ class QgsFillSymbolV2 : QgsSymbolV2
static QgsFillSymbolV2* createSimple( const QgsStringMap& properties ) /Factory/;

QgsFillSymbolV2( QgsSymbolLayerV2List layers /Transfer/ = QgsSymbolLayerV2List() );

void setAngle( double angle );
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, const QgsFeature* f, QgsRenderContext& context, int layer = -1, bool selected = false );

@@ -813,7 +813,7 @@ void QgsCategorizedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2* ramp

void QgsCategorizedSymbolRendererV2::setRotationField( QString fieldOrExpression )
{
if ( mSourceSymbol->type() == QgsSymbolV2::Marker )
if ( mSourceSymbol && mSourceSymbol->type() == QgsSymbolV2::Marker )
{
QgsMarkerSymbolV2 * s = static_cast<QgsMarkerSymbolV2 *>( mSourceSymbol.data() );
s->setDataDefinedAngle( QgsDataDefined( fieldOrExpression ) );
@@ -822,7 +822,7 @@ void QgsCategorizedSymbolRendererV2::setRotationField( QString fieldOrExpression

QString QgsCategorizedSymbolRendererV2::rotationField() const
{
if ( mSourceSymbol->type() == QgsSymbolV2::Marker )
if ( mSourceSymbol && mSourceSymbol->type() == QgsSymbolV2::Marker )
{
QgsMarkerSymbolV2 * s = static_cast<QgsMarkerSymbolV2 *>( mSourceSymbol.data() );
QgsDataDefined ddAngle = s->dataDefinedAngle();

0 comments on commit ac89dc0

Please sign in to comment.
You can’t perform that action at this time.