Skip to content
Permalink
Browse files

allow for expressions in symbol rotation and scale

the single, graduated and categorised symbol renderers have been
refactored to avoid use of raw pointers (auto_ptr are used instead, they
are deprecated in c++11 but the change for unique_ptr is an easy one and
they clearly state the design intend: exclusive ownership)

2 general use function to quote and unquote strings for/from xml have
been added to qgis.h
  • Loading branch information
vmora committed Jan 14, 2014
1 parent a31ebb4 commit 7d404d97cade814bbb44e2b63432eb3c08057c25
@@ -123,5 +123,9 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
void rebuildHash();

QgsSymbolV2* symbolForValue( QVariant value );

private:
QgsCategorizedSymbolRendererV2( const QgsCategorizedSymbolRendererV2 & );
QgsCategorizedSymbolRendererV2 & operator=( const QgsCategorizedSymbolRendererV2 & );
};

@@ -147,4 +147,8 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2

protected:
QgsSymbolV2* symbolForValue( double value );

private:
QgsGraduatedSymbolRendererV2( const QgsGraduatedSymbolRendererV2 & );
QgsGraduatedSymbolRendererV2 & operator=( const QgsGraduatedSymbolRendererV2 & );
};
@@ -65,4 +65,8 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2

void setTolerance( double t );
double tolerance() const;

private:
QgsPointDisplacementRenderer( const QgsPointDisplacementRenderer & );
QgsPointDisplacementRenderer & operator=( const QgsPointDisplacementRenderer & );
};
@@ -170,4 +170,8 @@ class QgsFeatureRendererV2
static const unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes, QgsRenderContext& context, const unsigned char* wkb );

void setScaleMethodToSymbol( QgsSymbolV2* symbol, int scaleMethod );
private:
QgsFeatureRendererV2( const QgsFeatureRendererV2 & );
QgsFeatureRendererV2 & operator=( const QgsFeatureRendererV2 & );

};
@@ -201,4 +201,8 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
static void refineRuleRanges( QgsRuleBasedRendererV2::Rule* initialRule, QgsGraduatedSymbolRendererV2* r );
//! take a rule and create a list of new rules with intervals of scales given by the passed scale denominators
static void refineRuleScales( QgsRuleBasedRendererV2::Rule* initialRule, QList<int> scales );

private:
QgsRuleBasedRendererV2( const QgsRuleBasedRendererV2 & );
QgsRuleBasedRendererV2 & operator=( const QgsRuleBasedRendererV2 & );
};
@@ -60,4 +60,8 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2
//! return a list of item text / symbol
//! @note: this method was added in version 1.5
// virtual QgsLegendSymbolList legendSymbolItems();

private:
QgsSingleSymbolRendererV2( const QgsSingleSymbolRendererV2 & );
QgsSingleSymbolRendererV2 & operator=( const QgsSingleSymbolRendererV2 & );
};
@@ -414,4 +414,27 @@ typedef unsigned long long qgssize;
#endif
#endif

inline
QString qgsXmlEncode( QString str )
{
// string passed as value to avoid internal copy
str.replace( "&", "&amp;" );
str.replace( "\"", "&quot;" );
str.replace( "'", "&apos;" );
str.replace( "<", "&lt;" );
str.replace( ">", "&gt;" );
return str;
}

inline
QString qgsXmlDecode( QString str )
{
// string passed as value to avoid internal copy
str.replace( "&amp;", "&" );
str.replace( "&quot;", "\"" );
str.replace( "&apos;", "'" );
str.replace( "&lt;", "<" );
str.replace( "&gt;", ">" );
return str;
}
#endif

0 comments on commit 7d404d9

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