Skip to content

Commit

Permalink
Remove more deprecated symbol methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 13, 2016
1 parent 55fc40d commit 4d4aec6
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 137 deletions.
8 changes: 8 additions & 0 deletions doc/api_break.dox
Expand Up @@ -920,13 +920,20 @@ be returned instead of a null pointer if no transformation is required.</li>
<li>Constructor variant with QgsMapRenderer has been removed. Use the variant with QgsMapSettings.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSvgCache QgsSvgCache

<ul>
<li>containsParamsV2() was removed. Use containsParamsV3() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbol QgsSymbol (renamed from QgsSymbolV2)

<ul>
<li>The OutputUnit enum, including QgsSymbol::MM, QgsSymbol::MapUnit, QgsSymbol::Mixed, QgsSymbol::Pixel and QgsSymbol::Percentage has been moved to QgsUnitTypes
and renamed to RenderUnit. QgsSymbol::OutputUnitList was renamed to QgsUnitTypes::RenderUnitList. All methods which previously accepted QgsSymbol::OutputUnit
parameters or QgsSymbol::OutputUnitList parameters now take QgsUnitTypes::RenderUnit or QgsUnitTypes::RenderUnitList parameters respectively.</li>
<li>startRender() now accepts a QgsFields reference, not a pointer.</li>
<li>isSymbolLayerCompatible() was removed. Use QgsSymbolLayer::isCompatibleWithSymbol() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbolLayer QgsSymbolLayer (renamed from QgsSymbolLayerV2)
Expand All @@ -947,6 +954,7 @@ the variant which takes QgsSymbolRenderContext instead.</li>

<ul>
<li>encodeOutputUnit() and decodeOutputUnit() were removed. QgsUnitTypes::encodeUnit() and QgsUnitTypes::decodeRenderUnit() should be used instead.</li>
<li>The signatures for wellKnownMarkerToSld() and wellKnownMarkerFromSld() were changed.</li>
</ul>

\subsection qgis_api_break_3_0_QgsTolerance QgsTolerance
Expand Down
20 changes: 0 additions & 20 deletions python/core/symbology-ng/qgssvgcache.sip
Expand Up @@ -112,26 +112,6 @@ class QgsSvgCache : QObject
void containsParams( const QString& path, bool& hasFillParam, QColor& defaultFillColor, bool& hasOutlineParam, QColor& defaultOutlineColor, bool& hasOutlineWidthParam,
double& defaultOutlineWidth ) const;

/** Tests if an svg file contains parameters for fill, outline color, outline width. If yes, possible default values are returned. If there are several
* default values in the svg file, only the first one is considered.
* @param path path to SVG file
* @param hasFillParam will be true if fill param present in SVG
* @param hasDefaultFillParam will be true if fill param has a default value specified
* @param defaultFillColor will be set to default fill color specified in SVG, if present
* @param hasOutlineParam will be true if outline param present in SVG
* @param hasDefaultOutlineColor will be true if outline param has a default value specified
* @param defaultOutlineColor will be set to default outline color specified in SVG, if present
* @param hasOutlineWidthParam will be true if outline width param present in SVG
* @param hasDefaultOutlineWidth will be true if outline width param has a default value specified
* @param defaultOutlineWidth will be set to default outline width specified in SVG, if present
* @note available in python bindings as containsParamsV2
* @note added in QGIS 2.12
* @deprecated use variant with fill and outline opacity
*/
void containsParams( const QString& path, bool& hasFillParam, bool& hasDefaultFillParam, QColor& defaultFillColor,
bool& hasOutlineParam, bool& hasDefaultOutlineColor, QColor& defaultOutlineColor,
bool& hasOutlineWidthParam, bool& hasDefaultOutlineWidth, double& defaultOutlineWidth ) const /Deprecated,PyName=containsParamsV2/;

/** Tests if an svg file contains parameters for fill, outline color, outline width. If yes, possible default values are returned. If there are several
* default values in the svg file, only the first one is considered.
* @param path path to SVG file
Expand Down
5 changes: 0 additions & 5 deletions python/core/symbology-ng/qgssymbol.sip
Expand Up @@ -274,11 +274,6 @@ class QgsSymbol
*/
void renderUsingLayer( QgsSymbolLayer* layer, QgsSymbolRenderContext& context );

//! check whether a symbol layer type can be used within the symbol
//! (marker-marker, line-line, fill-fill/line)
//! @deprecated since 2.14, use QgsSymbolLayer::isCompatibleWithSymbol instead
bool isSymbolLayerCompatible( SymbolType layerType );

//! Render editing vertex marker at specified point
//! @note added in QGIS 2.16
void renderVertexMarker( QPointF pt, QgsRenderContext& context, int currentVertexMarkerType, int currentVertexMarkerSize );
Expand Down
8 changes: 0 additions & 8 deletions python/core/symbology-ng/qgssymbollayerutils.sip
Expand Up @@ -171,17 +171,9 @@ class QgsSymbolLayerUtils
QString &path, QString &mime,
QColor &color, double &size );

/** @deprecated Use wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element, QString name, QColor color, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth, double size ) instead */
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
const QString& name, const QColor& color, const QColor& borderColor = QColor(),
double borderWidth = -1, double size = -1 ) /Deprecated/;
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
const QString& name, const QColor& color, const QColor& borderColor, Qt::PenStyle borderStyle,
double borderWidth = -1, double size = -1 );
/** @deprecated Use wellKnownMarkerFromSld( QDomElement &element, QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle, double &borderWidth, double &size ) instead */
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size ) /Deprecated/;

//! @note available in python as wellKnownMarkerFromSld2
static bool wellKnownMarkerFromSld( QDomElement &element,
Expand Down
3 changes: 0 additions & 3 deletions src/core/symbology-ng/qgscategorizedsymbolrenderer.h
Expand Up @@ -71,7 +71,6 @@ class CORE_EXPORT QgsRendererCategory

typedef QList<QgsRendererCategory> QgsCategoryList;

Q_NOWARN_DEPRECATED_PUSH
/** \ingroup core
* \class QgsCategorizedSymbolRenderer
*/
Expand Down Expand Up @@ -264,7 +263,5 @@ class CORE_EXPORT QgsCategorizedSymbolRenderer : public QgsFeatureRenderer
QVariant valueForFeature( QgsFeature& feature, QgsRenderContext &context ) const;

};
Q_NOWARN_DEPRECATED_POP


#endif // QGSCATEGORIZEDSYMBOLRENDERERV2_H
2 changes: 0 additions & 2 deletions src/core/symbology-ng/qgsgraduatedsymbolrenderer.h
Expand Up @@ -125,7 +125,6 @@ class CORE_EXPORT QgsRendererRangeLabelFormat
class QgsVectorLayer;
class QgsColorRamp;

Q_NOWARN_DEPRECATED_PUSH
/** \ingroup core
* \class QgsGraduatedSymbolRenderer
*/
Expand Down Expand Up @@ -414,6 +413,5 @@ class CORE_EXPORT QgsGraduatedSymbolRenderer : public QgsFeatureRenderer
QVariant valueForFeature( QgsFeature& feature, QgsRenderContext &context ) const;

};
Q_NOWARN_DEPRECATED_POP

#endif // QGSGRADUATEDSYMBOLRENDERERV2_H
2 changes: 0 additions & 2 deletions src/core/symbology-ng/qgssinglesymbolrenderer.h
Expand Up @@ -21,7 +21,6 @@
#include "qgsexpression.h"
#include <QScopedPointer>

Q_NOWARN_DEPRECATED_PUSH
/** \ingroup core
* \class QgsSingleSymbolRenderer
*/
Expand Down Expand Up @@ -103,7 +102,6 @@ class CORE_EXPORT QgsSingleSymbolRenderer : public QgsFeatureRenderer
QScopedPointer<QgsSymbol> mTempSymbol;
double mOrigSize;
};
Q_NOWARN_DEPRECATED_POP


#endif // QGSSINGLESYMBOLRENDERERV2_H
20 changes: 0 additions & 20 deletions src/core/symbology-ng/qgssvgcache.cpp
Expand Up @@ -249,26 +249,6 @@ void QgsSvgCache::containsParams( const QString& path, bool& hasFillParam, QColo
hasOutlineOpacityParam, hasDefaultOutlineOpacity, defaultOutlineOpacity );
}


void QgsSvgCache::containsParams( const QString& path,
bool& hasFillParam, bool& hasDefaultFillParam, QColor& defaultFillColor,
bool& hasOutlineParam, bool& hasDefaultOutlineColor, QColor& defaultOutlineColor,
bool& hasOutlineWidthParam, bool& hasDefaultOutlineWidth, double& defaultOutlineWidth ) const
{
bool hasFillOpacityParam = false;
bool hasDefaultFillOpacity = false;
double defaultFillOpacity = 1.0;
bool hasOutlineOpacityParam = false;
bool hasDefaultOutlineOpacity = false;
double defaultOutlineOpacity = 1.0;

containsParams( path, hasFillParam, hasDefaultFillParam, defaultFillColor,
hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
hasOutlineParam, hasDefaultOutlineColor, defaultOutlineColor,
hasOutlineWidthParam, hasDefaultOutlineWidth, defaultOutlineWidth,
hasOutlineOpacityParam, hasDefaultOutlineOpacity, defaultOutlineOpacity );
}

void QgsSvgCache::containsParams( const QString& path,
bool& hasFillParam, bool& hasDefaultFillParam, QColor& defaultFillColor,
bool& hasFillOpacityParam, bool& hasDefaultFillOpacity, double& defaultFillOpacity,
Expand Down
20 changes: 0 additions & 20 deletions src/core/symbology-ng/qgssvgcache.h
Expand Up @@ -145,26 +145,6 @@ class CORE_EXPORT QgsSvgCache : public QObject
void containsParams( const QString& path, bool& hasFillParam, QColor& defaultFillColor, bool& hasOutlineParam, QColor& defaultOutlineColor, bool& hasOutlineWidthParam,
double& defaultOutlineWidth ) const;

/** Tests if an svg file contains parameters for fill, outline color, outline width. If yes, possible default values are returned. If there are several
* default values in the svg file, only the first one is considered.
* @param path path to SVG file
* @param hasFillParam will be true if fill param present in SVG
* @param hasDefaultFillParam will be true if fill param has a default value specified
* @param defaultFillColor will be set to default fill color specified in SVG, if present
* @param hasOutlineParam will be true if outline param present in SVG
* @param hasDefaultOutlineColor will be true if outline param has a default value specified
* @param defaultOutlineColor will be set to default outline color specified in SVG, if present
* @param hasOutlineWidthParam will be true if outline width param present in SVG
* @param hasDefaultOutlineWidth will be true if outline width param has a default value specified
* @param defaultOutlineWidth will be set to default outline width specified in SVG, if present
* @note available in python bindings as containsParamsV2
* @note added in QGIS 2.12
* @deprecated use variant with fill and outline opacity
*/
Q_DECL_DEPRECATED void containsParams( const QString& path, bool& hasFillParam, bool& hasDefaultFillParam, QColor& defaultFillColor,
bool& hasOutlineParam, bool& hasDefaultOutlineColor, QColor& defaultOutlineColor,
bool& hasOutlineWidthParam, bool& hasDefaultOutlineWidth, double& defaultOutlineWidth ) const;

/** Tests if an svg file contains parameters for fill, outline color, outline width. If yes, possible default values are returned. If there are several
* default values in the svg file, only the first one is considered.
* @param path path to SVG file
Expand Down
11 changes: 0 additions & 11 deletions src/core/symbology-ng/qgssymbol.cpp
Expand Up @@ -324,17 +324,6 @@ QgsSymbolLayer* QgsSymbol::symbolLayer( int layer )
return mLayers.value( layer );
}


bool QgsSymbol::isSymbolLayerCompatible( SymbolType layerType )
{
// fill symbol can contain also line symbol layers for drawing of outlines
if ( mType == Fill && layerType == Line )
return true;

return mType == layerType;
}


bool QgsSymbol::insertSymbolLayer( int index, QgsSymbolLayer* layer )
{
if ( index < 0 || index > mLayers.count() ) // can be added also after the last index
Expand Down
5 changes: 0 additions & 5 deletions src/core/symbology-ng/qgssymbol.h
Expand Up @@ -334,11 +334,6 @@ class CORE_EXPORT QgsSymbol
*/
void renderUsingLayer( QgsSymbolLayer* layer, QgsSymbolRenderContext& context );

//! check whether a symbol layer type can be used within the symbol
//! (marker-marker, line-line, fill-fill/line)
//! @deprecated since 2.14, use QgsSymbolLayer::isCompatibleWithSymbol instead
Q_DECL_DEPRECATED bool isSymbolLayerCompatible( SymbolType layerType );

//! Render editing vertex marker at specified point
//! @note added in QGIS 2.16
void renderVertexMarker( QPointF pt, QgsRenderContext& context, int currentVertexMarkerType, int currentVertexMarkerSize );
Expand Down
31 changes: 0 additions & 31 deletions src/core/symbology-ng/qgssymbollayerutils.cpp
Expand Up @@ -769,22 +769,6 @@ QList<QPolygonF> offsetLine( QPolygonF polyline, double dist, QgsWkbTypes::Geome
return resultLine;
}

QList<QPolygonF> offsetLine( const QPolygonF& polyline, double dist )
{
QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::PointGeometry;
int pointCount = polyline.count();

if ( pointCount > 3 && qgsDoubleNear( polyline[ 0 ].x(), polyline[ pointCount - 1 ].x() ) && qgsDoubleNear( polyline[ 0 ].y(), polyline[ pointCount - 1 ].y() ) )
{
geometryType = QgsWkbTypes::PolygonGeometry;
}
else if ( pointCount > 1 )
{
geometryType = QgsWkbTypes::LineGeometry;
}
return offsetLine( polyline, dist, geometryType );
}

/////


Expand Down Expand Up @@ -2050,13 +2034,6 @@ bool QgsSymbolLayerUtils::externalMarkerFromSld( QDomElement &element,
return true;
}

void QgsSymbolLayerUtils::wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
const QString& name, const QColor& color, const QColor& borderColor,
double borderWidth, double size )
{
wellKnownMarkerToSld( doc, element, name, color, borderColor, Qt::SolidLine, borderWidth, size );
}

void QgsSymbolLayerUtils::wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
const QString& name, const QColor& color, const QColor& borderColor, Qt::PenStyle borderStyle,
double borderWidth, double size )
Expand Down Expand Up @@ -2093,14 +2070,6 @@ void QgsSymbolLayerUtils::wellKnownMarkerToSld( QDomDocument &doc, QDomElement &
}
}

bool QgsSymbolLayerUtils::wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size )
{
Qt::PenStyle borderStyle;
return wellKnownMarkerFromSld( element, name, color, borderColor, borderStyle, borderWidth, size );
}

bool QgsSymbolLayerUtils::wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle,
double &borderWidth, double &size )
Expand Down
10 changes: 0 additions & 10 deletions src/core/symbology-ng/qgssymbollayerutils.h
Expand Up @@ -238,17 +238,9 @@ class CORE_EXPORT QgsSymbolLayerUtils
QString &path, QString &mime,
QColor &color, double &size );

/** @deprecated Use wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element, QString name, QColor color, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth, double size ) instead */
Q_DECL_DEPRECATED static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
const QString& name, const QColor& color, const QColor& borderColor = QColor(),
double borderWidth = -1, double size = -1 );
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
const QString& name, const QColor& color, const QColor& borderColor, Qt::PenStyle borderStyle,
double borderWidth = -1, double size = -1 );
/** @deprecated Use wellKnownMarkerFromSld( QDomElement &element, QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle, double &borderWidth, double &size ) instead */
Q_DECL_DEPRECATED static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size );

//! @note available in python as wellKnownMarkerFromSld2
static bool wellKnownMarkerFromSld( QDomElement &element,
Expand Down Expand Up @@ -566,8 +558,6 @@ class CORE_EXPORT QgsSymbolLayerUtils

class QPolygonF;

//! @deprecated since 2.4 - calculate line shifted by a specified distance
QList<QPolygonF> offsetLine( const QPolygonF& polyline, double dist );
//! calculate geometry shifted by a specified distance
QList<QPolygonF> offsetLine( QPolygonF polyline, double dist, QgsWkbTypes::GeometryType geometryType );

Expand Down

0 comments on commit 4d4aec6

Please sign in to comment.