Skip to content

Commit

Permalink
allow for expressions in symbol rotation and scale
Browse files Browse the repository at this point in the history
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 7d404d9
Show file tree
Hide file tree
Showing 19 changed files with 362 additions and 314 deletions.
4 changes: 4 additions & 0 deletions python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip
Expand Up @@ -123,5 +123,9 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
void rebuildHash();

QgsSymbolV2* symbolForValue( QVariant value );

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

4 changes: 4 additions & 0 deletions python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
Expand Up @@ -147,4 +147,8 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2

protected:
QgsSymbolV2* symbolForValue( double value );

private:
QgsGraduatedSymbolRendererV2( const QgsGraduatedSymbolRendererV2 & );
QgsGraduatedSymbolRendererV2 & operator=( const QgsGraduatedSymbolRendererV2 & );
};
4 changes: 4 additions & 0 deletions python/core/symbology-ng/qgspointdisplacementrenderer.sip
Expand Up @@ -65,4 +65,8 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2

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

private:
QgsPointDisplacementRenderer( const QgsPointDisplacementRenderer & );
QgsPointDisplacementRenderer & operator=( const QgsPointDisplacementRenderer & );
};
4 changes: 4 additions & 0 deletions python/core/symbology-ng/qgsrendererv2.sip
Expand Up @@ -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 & );

};
4 changes: 4 additions & 0 deletions python/core/symbology-ng/qgsrulebasedrendererv2.sip
Expand Up @@ -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 & );
};
4 changes: 4 additions & 0 deletions python/core/symbology-ng/qgssinglesymbolrendererv2.sip
Expand Up @@ -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 & );
};
23 changes: 23 additions & 0 deletions src/core/qgis.h
Expand Up @@ -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.