Skip to content
Permalink
Browse files

Remove more deprecated symbol methods

  • Loading branch information
nyalldawson committed Sep 13, 2016
1 parent 55fc40d commit 4d4aec692a1c35aea4aa71b76c101235524fdddb
@@ -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)
@@ -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
@@ -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
@@ -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 );
@@ -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,
@@ -71,7 +71,6 @@ class CORE_EXPORT QgsRendererCategory

typedef QList<QgsRendererCategory> QgsCategoryList;

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

};
Q_NOWARN_DEPRECATED_POP


#endif // QGSCATEGORIZEDSYMBOLRENDERERV2_H
@@ -125,7 +125,6 @@ class CORE_EXPORT QgsRendererRangeLabelFormat
class QgsVectorLayer;
class QgsColorRamp;

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

};
Q_NOWARN_DEPRECATED_POP

#endif // QGSGRADUATEDSYMBOLRENDERERV2_H
@@ -21,7 +21,6 @@
#include "qgsexpression.h"
#include <QScopedPointer>

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


#endif // QGSSINGLESYMBOLRENDERERV2_H
@@ -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,
@@ -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
@@ -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
@@ -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 );
@@ -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 );
}

/////


@@ -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 )
@@ -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 )
@@ -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,
@@ -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 );

0 comments on commit 4d4aec6

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