Skip to content
Permalink
Browse files
symbology-ng: make dump() methods const
  • Loading branch information
jef-n committed Jul 22, 2013
1 parent aa7c428 commit cf22bcf38365db87dabea4a8dd1294ab36381363
@@ -22,7 +22,7 @@ class QgsRendererCategoryV2
void setLabel( const QString &label );

// debugging
QString dump();
QString dump() const;

void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const;
};
@@ -49,7 +49,7 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2

virtual QList<QString> usedAttributes();

virtual QString dump();
virtual QString dump() const;

virtual QgsFeatureRendererV2* clone() /Factory/;

@@ -22,7 +22,7 @@ class QgsRendererRangeV2
void setUpperValue( double upperValue );

// debugging
QString dump();
QString dump() const;

void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const;
};
@@ -48,7 +48,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2

virtual QList<QString> usedAttributes();

virtual QString dump();
virtual QString dump() const;

virtual QgsFeatureRendererV2* clone() /Factory/;

@@ -112,6 +112,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2

//! return a list of item text / symbol
//! @note: this method was added in version 1.5
//! @note not available in python bindings
// virtual QgsLegendSymbolList legendSymbolItems();

QgsSymbolV2* sourceSymbol();
@@ -70,15 +70,15 @@ class QgsFeatureRendererV2
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );

//! for debugging
virtual QString dump();
virtual QString dump() const;

enum Capabilities
{
SymbolLevels = 1, // rendering with symbol levels (i.e. implements symbols(), symbolForFeature())
RotationField = 2, // rotate symbols by attribute value
MoreSymbolsPerFeature = 4 // may use more than one symbol to render a feature: symbolsForFeature() will return them
Filter = 8, // features may be filtered, i.e. some features may not be rendered (categorized, rule based ...)
ScaleDependent = 16 // dependends on scale if feature will be rendered (rule based )
ScaleDependent = 16 // depends on scale if feature will be rendered (rule based )
};

//! returns bitwise OR-ed capabilities of the renderer
@@ -123,6 +123,7 @@ class QgsFeatureRendererV2

//! return a list of item text / symbol
//! @note: this method was added in version 1.5
//! @note: not available in python bindings
// virtual QgsLegendSymbolList legendSymbolItems();

//! set type and size of editing vertex markers for subsequent rendering
@@ -35,7 +35,7 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2
//! @note added in 2.0
QgsSymbolV2::ScaleMethod scaleMethod() const;

virtual QString dump();
virtual QString dump() const;

virtual QgsFeatureRendererV2* clone() /Factory/;

@@ -83,7 +83,7 @@ class QgsSymbolV2

QImage bigSymbolPreviewImage();

QString dump();
QString dump() const;

virtual QgsSymbolV2* clone() const = 0 /Factory/;

@@ -97,7 +97,7 @@ void QgsRendererCategoryV2::setLabel( const QString &label )
mLabel = label;
}

QString QgsRendererCategoryV2::dump()
QString QgsRendererCategoryV2::dump() const
{
return QString( "%1::%2::%3\n" ).arg( mValue.toString() ).arg( mLabel ).arg( mSymbol->dump() );
}
@@ -425,7 +425,7 @@ QList<QString> QgsCategorizedSymbolRendererV2::usedAttributes()
return attributes.toList();
}

QString QgsCategorizedSymbolRendererV2::dump()
QString QgsCategorizedSymbolRendererV2::dump() const
{
QString s = QString( "CATEGORIZED: idx %1\n" ).arg( mAttrName );
for ( int i = 0; i < mCategories.count(); i++ )
@@ -48,7 +48,7 @@ class CORE_EXPORT QgsRendererCategoryV2
void setLabel( const QString &label );

// debugging
QString dump();
QString dump() const;

void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const;

@@ -76,7 +76,7 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2

virtual QList<QString> usedAttributes();

virtual QString dump();
virtual QString dump() const;

virtual QgsFeatureRendererV2* clone();

@@ -112,7 +112,7 @@ void QgsRendererRangeV2::setLowerValue( double lowerValue )
mLowerValue = lowerValue;
}

QString QgsRendererRangeV2::dump()
QString QgsRendererRangeV2::dump() const
{
return QString( "%1 - %2::%3::%4\n" ).arg( mLowerValue ).arg( mUpperValue ).arg( mLabel ).arg( mSymbol->dump() );
}
@@ -336,7 +336,7 @@ bool QgsGraduatedSymbolRendererV2::updateRangeLowerValue( int rangeIndex, double
return true;
}

QString QgsGraduatedSymbolRendererV2::dump()
QString QgsGraduatedSymbolRendererV2::dump() const
{
QString s = QString( "GRADUATED: attr %1\n" ).arg( mAttrName );
for ( int i = 0; i < mRanges.count(); i++ )
@@ -41,7 +41,7 @@ class CORE_EXPORT QgsRendererRangeV2
void setUpperValue( double upperValue );

// debugging
QString dump();
QString dump() const;

void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const;

@@ -71,7 +71,7 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2

virtual QList<QString> usedAttributes();

virtual QString dump();
virtual QString dump() const;

virtual QgsFeatureRendererV2* clone();

@@ -362,7 +362,7 @@ void QgsFeatureRendererV2::renderFeatureWithSymbol( QgsFeature& feature, QgsSymb
}
}

QString QgsFeatureRendererV2::dump()
QString QgsFeatureRendererV2::dump() const
{
return "UNKNOWN RENDERER\n";
}
@@ -94,15 +94,15 @@ class CORE_EXPORT QgsFeatureRendererV2
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );

//! for debugging
virtual QString dump();
virtual QString dump() const;

enum Capabilities
{
SymbolLevels = 1, // rendering with symbol levels (i.e. implements symbols(), symbolForFeature())
RotationField = 1 << 1, // rotate symbols by attribute value
MoreSymbolsPerFeature = 1 << 2, // may use more than one symbol to render a feature: symbolsForFeature() will return them
Filter = 1 << 3, // features may be filtered, i.e. some features may not be rendered (categorized, rule based ...)
ScaleDependent = 1 << 4 // dependends on scale if feature will be rendered (rule based )
ScaleDependent = 1 << 4 // depends on scale if feature will be rendered (rule based )
};

//! returns bitwise OR-ed capabilities of the renderer
@@ -886,7 +886,7 @@ void QgsRuleBasedRendererV2::refineRuleScales( QgsRuleBasedRendererV2::Rule* ini
initialRule->appendChild( new Rule( symbol->clone(), oldScale, maxDenom, QString(), QString( "%1 - %2" ).arg( oldScale ).arg( maxDenom ) ) );
}

QString QgsRuleBasedRendererV2::dump()
QString QgsRuleBasedRendererV2::dump() const
{
QString msg( "Rule-based renderer:\n" );
msg += mRootRule->dump();
@@ -223,7 +223,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
virtual QgsLegendSymbolList legendSymbolItems();

//! for debugging
virtual QString dump();
virtual QString dump() const;

//! return whether the renderer will render a feature or not.
//! Must be called between startRender() and stopRender() calls.
@@ -173,7 +173,7 @@ void QgsSingleSymbolRendererV2::setScaleMethod( QgsSymbolV2::ScaleMethod scaleMe
setScaleMethodToSymbol( mSymbol, scaleMethod );
}

QString QgsSingleSymbolRendererV2::dump()
QString QgsSingleSymbolRendererV2::dump() const
{
if ( mSymbol )
{
@@ -53,7 +53,7 @@ class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2
//! @note added in 2.0
QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; }

virtual QString dump();
virtual QString dump() const;

virtual QgsFeatureRendererV2* clone();

@@ -237,9 +237,9 @@ void QgsSymbolV2::setColor( const QColor& color )
}
}

QColor QgsSymbolV2::color()
QColor QgsSymbolV2::color() const
{
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
for ( QgsSymbolLayerV2List::const_iterator it = mLayers.begin(); it != mLayers.end(); ++it )
{
// return color of the first unlocked layer
if ( !( *it )->isLocked() )
@@ -313,7 +313,7 @@ QImage QgsSymbolV2::bigSymbolPreviewImage()
}


QString QgsSymbolV2::dump()
QString QgsSymbolV2::dump() const
{
QString t;
switch ( type() )
@@ -325,7 +325,7 @@ QString QgsSymbolV2::dump()
}
QString s = QString( "%1 SYMBOL (%2 layers) color %3" ).arg( t ).arg( mLayers.count() ).arg( QgsSymbolLayerV2Utils::encodeColor( color() ) );

for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
for ( QgsSymbolLayerV2List::const_iterator it = mLayers.begin(); it != mLayers.end(); ++it )
{
// TODO:
}
@@ -101,13 +101,13 @@ class CORE_EXPORT QgsSymbolV2
void stopRender( QgsRenderContext& context );

void setColor( const QColor& color );
QColor color();
QColor color() const;

void drawPreviewIcon( QPainter* painter, QSize size );

QImage bigSymbolPreviewImage();

QString dump();
QString dump() const;

virtual QgsSymbolV2* clone() const = 0;

0 comments on commit cf22bcf

Please sign in to comment.