diff --git a/python/core/symbology-ng/qgsrendererv2.sip b/python/core/symbology-ng/qgsrendererv2.sip index 6963412f05d..5996b33ce51 100644 --- a/python/core/symbology-ng/qgsrendererv2.sip +++ b/python/core/symbology-ng/qgsrendererv2.sip @@ -263,15 +263,6 @@ class QgsFeatureRendererV2 */ void setForceRasterRender( bool forceRaster ); - /** Returns the result of the feature rendering operation. This should only be - * called immediately after a rendering operation (eg calling renderFeature). - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 renderFeature - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderFeature return a QgsRenderResult - const QgsRenderResult& renderResult() const; - protected: QgsFeatureRendererV2( QString type ); @@ -300,16 +291,6 @@ class QgsFeatureRendererV2 */ void copyPaintEffect( QgsFeatureRendererV2 *destRenderer ) const; - /** Sets the result of the symbol rendering operation. Subclasses should call - * this method after rendering a feature and update the render result to reflect - * to actual result of the feature render. - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the renderFeature method - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - void setRenderResult( const QgsRenderResult& result ); - private: QgsFeatureRendererV2( const QgsFeatureRendererV2 & ); QgsFeatureRendererV2 & operator=( const QgsFeatureRendererV2 & ); diff --git a/python/core/symbology-ng/qgssymbollayerv2.sip b/python/core/symbology-ng/qgssymbollayerv2.sip index 9e2ae5cdc2b..edce98f18af 100644 --- a/python/core/symbology-ng/qgssymbollayerv2.sip +++ b/python/core/symbology-ng/qgssymbollayerv2.sip @@ -260,15 +260,6 @@ class QgsSymbolLayerV2 */ void setPaintEffect( QgsPaintEffect* effect /Transfer/); - /** Returns the result of the symbol rendering operation. This should only be - * called immediately after a rendering operation (eg calling renderPoint). - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the render methods - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - const QgsRenderResult& renderResult() const; - protected: QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false ); @@ -315,16 +306,6 @@ class QgsSymbolLayerV2 */ void copyPaintEffect( QgsSymbolLayerV2* destLayer ) const; - /** Sets the result of the symbol rendering operation. Subclasses should call - * this method after rendering a symbol and update the render result to reflect - * to actual result of the symbol render. - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the render methods - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - void setRenderResult( const QgsRenderResult& result ); - }; ////////////////////// diff --git a/python/core/symbology-ng/qgssymbolv2.sip b/python/core/symbology-ng/qgssymbolv2.sip index f8322ff573e..4962995d081 100644 --- a/python/core/symbology-ng/qgssymbolv2.sip +++ b/python/core/symbology-ng/qgssymbolv2.sip @@ -1,39 +1,6 @@ typedef QList QgsSymbolLayerV2List; -/** \ingroup core - * \class QgsRenderResult - * \brief A simple container for the results of a rendering operation - * \note Added in version 2.12 - */ - -class QgsRenderResult -{ -%TypeHeaderCode -#include -%End - public: - - /** Constructor for QgsRenderResult - * @param symbolRendered initial value for symbolRendered member - */ - QgsRenderResult( bool symbolRendered ); - - /** Bounds of rendered symbol shape. - * @note only implemented for marker symbol types - */ - QRectF symbolBounds; - - //! True if a symbol was rendered during the render operation - bool symbolRendered; - - /** Unites the render result with another QgsRenderResult object - * @param other other render result - */ - void unite( const QgsRenderResult& other ); -}; - - class QgsSymbolV2 { %TypeHeaderCode @@ -196,15 +163,6 @@ class QgsSymbolV2 void setLayer( const QgsVectorLayer* layer ); const QgsVectorLayer* layer() const; - /** Returns the result of the symbol rendering operation. This should only be - * called immediately after a rendering operation (eg calling renderPoint). - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the render methods - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - const QgsRenderResult& renderResult() const; - protected: QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers /Transfer/ ); // can't be instantiated diff --git a/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp b/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp index 3ab97569658..37c81f0c3a7 100644 --- a/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp +++ b/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp @@ -541,18 +541,15 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV } } - QgsRenderResult result( true ); if ( mUsingCache ) { //QgsDebugMsg( QString("XXX using cache") ); // we will use cached image QImage &img = context.selected() ? mSelCache : mCache; double s = img.width() / context.renderContext().rasterScaleFactor(); - QRectF imgRect( point.x() - s / 2.0 + off.x(), - point.y() - s / 2.0 + off.y(), - s, s ); - p->drawImage( imgRect, img ); - result.symbolBounds = imgRect; + p->drawImage( QRectF( point.x() - s / 2.0 + off.x(), + point.y() - s / 2.0 + off.y(), + s, s ), img ); } else { @@ -609,25 +606,11 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV p->setBrush( context.selected() ? mSelBrush : mBrush ); p->setPen( context.selected() ? mSelPen : mPen ); - QRectF boundingRect; if ( !mPolygon.isEmpty() ) - { - QPolygonF transformed = transform.map( mPolygon ); - boundingRect = transformed.boundingRect(); - p->drawPolygon( transformed ); - - } + p->drawPolygon( transform.map( mPolygon ) ); else - { - QPainterPath transformed = transform.map( mPath ); - boundingRect = transformed.boundingRect(); - p->drawPath( transformed ); - } - //adjust bounding rect for pen width - result.symbolBounds = boundingRect.adjusted( -mPen.widthF() / 2.0, -mPen.widthF() / 2.0, - mPen.widthF() / 2.0, mPen.widthF() / 2.0 ); + p->drawPath( transform.map( mPath ) ); } - setRenderResult( result ); } diff --git a/src/core/symbology-ng/qgsrendererv2.cpp b/src/core/symbology-ng/qgsrendererv2.cpp index 26784cce0d8..a5823833b7d 100644 --- a/src/core/symbology-ng/qgsrendererv2.cpp +++ b/src/core/symbology-ng/qgsrendererv2.cpp @@ -218,7 +218,6 @@ QgsFeatureRendererV2::QgsFeatureRendererV2( QString type ) , mCurrentVertexMarkerSize( 3 ) , mPaintEffect( 0 ) , mForceRaster( false ) - , mRenderResult( QgsRenderResult( true ) ) { mPaintEffect = QgsPaintEffectRegistry::defaultStack(); mPaintEffect->setEnabled( false ); @@ -271,13 +270,9 @@ bool QgsFeatureRendererV2::renderFeature( QgsFeature& feature, QgsRenderContext& { QgsSymbolV2* symbol = symbolForFeature( feature, context ); if ( symbol == NULL ) - { - setRenderResult( QgsRenderResult( false ) ); return false; - } renderFeatureWithSymbol( feature, symbol, context, layer, selected, drawVertexMarker ); - setRenderResult( symbol->renderResult() ); return true; } @@ -815,8 +810,3 @@ void QgsFeatureRendererV2::convertSymbolRotation( QgsSymbolV2 * symbol, const QS s->setDataDefinedAngle( dd ); } } - -void QgsFeatureRendererV2::setRenderResult( const QgsRenderResult& result ) -{ - mRenderResult = result; -} diff --git a/src/core/symbology-ng/qgsrendererv2.h b/src/core/symbology-ng/qgsrendererv2.h index 7a243c25fe0..bac4ff39ab1 100644 --- a/src/core/symbology-ng/qgsrendererv2.h +++ b/src/core/symbology-ng/qgsrendererv2.h @@ -311,15 +311,6 @@ class CORE_EXPORT QgsFeatureRendererV2 */ void setForceRasterRender( bool forceRaster ) { mForceRaster = forceRaster; } - /** Returns the result of the feature rendering operation. This should only be - * called immediately after a rendering operation (eg calling renderFeature). - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 renderFeature - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderFeature return a QgsRenderResult - const QgsRenderResult& renderResult() const { return mRenderResult; } - protected: QgsFeatureRendererV2( QString type ); @@ -370,20 +361,8 @@ class CORE_EXPORT QgsFeatureRendererV2 */ static void convertSymbolRotation( QgsSymbolV2 * symbol, const QString & field ); - /** Sets the result of the symbol rendering operation. Subclasses should call - * this method after rendering a feature and update the render result to reflect - * to actual result of the feature render. - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the renderFeature method - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - void setRenderResult( const QgsRenderResult& result ); - private: Q_DISABLE_COPY( QgsFeatureRendererV2 ) - - QgsRenderResult mRenderResult; }; // for some reason SIP compilation fails if these lines are not included: diff --git a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp index 70c5121c2d4..96be597f8d4 100644 --- a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp +++ b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp @@ -816,8 +816,6 @@ bool QgsRuleBasedRendererV2::renderFeature( QgsFeature& feature, { Q_UNUSED( layer ); - setRenderResult( QgsRenderResult( false ) ); - int flags = ( selected ? FeatIsSelected : 0 ) | ( drawVertexMarker ? FeatDrawMarkers : 0 ); mCurrentFeatures.append( FeatureToRender( feature, flags ) ); @@ -876,10 +874,6 @@ void QgsRuleBasedRendererV2::stopRender( QgsRenderContext& context ) { int flags = job->ftr.flags; renderFeatureWithSymbol( job->ftr.feat, job->symbol, context, i, flags & FeatIsSelected, flags & FeatDrawMarkers ); - - QgsRenderResult newRenderResult = job->symbol->renderResult(); - newRenderResult.unite( renderResult() ); - setRenderResult( newRenderResult ); } } } diff --git a/src/core/symbology-ng/qgssymbollayerv2.cpp b/src/core/symbology-ng/qgssymbollayerv2.cpp index a097e574799..d842e25c6ed 100644 --- a/src/core/symbology-ng/qgssymbollayerv2.cpp +++ b/src/core/symbology-ng/qgssymbollayerv2.cpp @@ -334,7 +334,6 @@ QgsSymbolLayerV2::QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked ) , mLocked( locked ) , mRenderingPass( 0 ) , mPaintEffect( 0 ) - , mRenderResult( QgsRenderResult( true ) ) { mPaintEffect = QgsPaintEffectRegistry::defaultStack(); mPaintEffect->setEnabled( false ); @@ -483,11 +482,6 @@ void QgsSymbolLayerV2::copyPaintEffect( QgsSymbolLayerV2 *destLayer ) const destLayer->setPaintEffect( mPaintEffect->clone() ); } -void QgsSymbolLayerV2::setRenderResult( const QgsRenderResult& result ) -{ - mRenderResult = result; -} - QgsMarkerSymbolLayerV2::QgsMarkerSymbolLayerV2( bool locked ) : QgsSymbolLayerV2( QgsSymbolV2::Marker, locked ) , mAngle( 0 ) diff --git a/src/core/symbology-ng/qgssymbollayerv2.h b/src/core/symbology-ng/qgssymbollayerv2.h index c8bd4043d33..cce8c314cd8 100644 --- a/src/core/symbology-ng/qgssymbollayerv2.h +++ b/src/core/symbology-ng/qgssymbollayerv2.h @@ -247,15 +247,6 @@ class CORE_EXPORT QgsSymbolLayerV2 */ void setPaintEffect( QgsPaintEffect* effect ); - /** Returns the result of the symbol rendering operation. This should only be - * called immediately after a rendering operation (eg calling renderPoint). - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the render methods - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - const QgsRenderResult& renderResult() const { return mRenderResult; } - protected: QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false ); @@ -316,16 +307,6 @@ class CORE_EXPORT QgsSymbolLayerV2 */ void copyPaintEffect( QgsSymbolLayerV2* destLayer ) const; - /** Sets the result of the symbol rendering operation. Subclasses should call - * this method after rendering a symbol and update the render result to reflect - * to actual result of the symbol render. - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the render methods - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - void setRenderResult( const QgsRenderResult& result ); - static const QString EXPR_SIZE; static const QString EXPR_ANGLE; static const QString EXPR_NAME; @@ -384,10 +365,6 @@ class CORE_EXPORT QgsSymbolLayerV2 static const QString EXPR_OFFSET_ALONG_LINE; static const QString EXPR_HORIZONTAL_ANCHOR_POINT; static const QString EXPR_VERTICAL_ANCHOR_POINT; - - private: - - QgsRenderResult mRenderResult; }; ////////////////////// diff --git a/src/core/symbology-ng/qgssymbolv2.cpp b/src/core/symbology-ng/qgssymbolv2.cpp index 2fb4738a465..851e054e04b 100644 --- a/src/core/symbology-ng/qgssymbolv2.cpp +++ b/src/core/symbology-ng/qgssymbolv2.cpp @@ -81,7 +81,6 @@ QgsSymbolV2::QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ) , mRenderHints( 0 ) , mClipFeaturesToExtent( true ) , mLayer( 0 ) - , mRenderResult( QgsRenderResult( true ) ) { // check they're all correct symbol layers @@ -832,8 +831,6 @@ void QgsMarkerSymbolV2::renderPointUsingLayer( QgsMarkerSymbolLayerV2* layer, co { layer->renderPoint( point, context ); } - - mRenderResult = layer->renderResult(); } void QgsMarkerSymbolV2::renderPoint( const QPointF& point, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected ) @@ -849,13 +846,10 @@ void QgsMarkerSymbolV2::renderPoint( const QPointF& point, const QgsFeature* f, return; } - QgsRenderResult combinedResult( false ); for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it ) { renderPointUsingLayer(( QgsMarkerSymbolLayerV2* ) * it, point, symbolContext ); - combinedResult.unite(( *it )->renderResult() ); } - mRenderResult = combinedResult; } QgsSymbolV2* QgsMarkerSymbolV2::clone() const @@ -1038,8 +1032,6 @@ void QgsLineSymbolV2::renderPolylineUsingLayer( QgsLineSymbolLayerV2 *layer, con { layer->renderPolyline( points, context ); } - - mRenderResult = layer->renderResult(); } @@ -1120,8 +1112,6 @@ void QgsFillSymbolV2::renderPolygonUsingLayer( QgsSymbolLayerV2* layer, const QP (( QgsLineSymbolLayerV2* )layer )->renderPolygonOutline( points, rings, context ); } } - - mRenderResult = layer->renderResult(); } QRectF QgsFillSymbolV2::polygonBounds( const QPolygonF& points, const QList* rings ) const diff --git a/src/core/symbology-ng/qgssymbolv2.h b/src/core/symbology-ng/qgssymbolv2.h index bf443f3ef38..5933d06af39 100644 --- a/src/core/symbology-ng/qgssymbolv2.h +++ b/src/core/symbology-ng/qgssymbolv2.h @@ -45,48 +45,6 @@ class QgsDataDefined; typedef QList QgsSymbolLayerV2List; - -/** \ingroup core - * \class QgsRenderResult - * \brief A simple container for the results of a rendering operation - * \note Added in version 2.12 - */ - -class QgsRenderResult -{ - public: - - /** Constructor for QgsRenderResult - * @param symbolRendered initial value for symbolRendered member - */ - QgsRenderResult( bool symbolRendered ) - : symbolRendered( symbolRendered ) - { } - - /** Bounds of rendered symbol shape. - * @note only implemented for marker symbol types - */ - QRectF symbolBounds; - - //! True if a symbol was rendered during the render operation - bool symbolRendered; - - /** Unites the render result with another QgsRenderResult object - * @param other other render result - */ - void unite( const QgsRenderResult& other ) - { - symbolRendered = symbolRendered || other.symbolRendered; - if ( !symbolBounds.isValid() ) - symbolBounds = other.symbolBounds; - else - symbolBounds = symbolBounds.united( other.symbolBounds ); - } -}; - - -////////////////////// - class CORE_EXPORT QgsSymbolV2 { public: @@ -263,15 +221,6 @@ class CORE_EXPORT QgsSymbolV2 void setLayer( const QgsVectorLayer* layer ) { mLayer = layer; } const QgsVectorLayer* layer() const { return mLayer; } - /** Returns the result of the symbol rendering operation. This should only be - * called immediately after a rendering operation (eg calling renderPoint). - * @note added in QGIS 2.12 - * @note this is a temporary method until QGIS 3.0. For QGIS 3.0 the render methods - * will return a QgsRenderResult object - */ - // TODO - QGIS 3.0. Remove and make renderPoint, etc return a QgsRenderResult - const QgsRenderResult& renderResult() const { return mRenderResult; } - protected: QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ); // can't be instantiated @@ -292,8 +241,6 @@ class CORE_EXPORT QgsSymbolV2 const QgsVectorLayer* mLayer; //current vectorlayer - QgsRenderResult mRenderResult; - }; /////////////////////// @@ -352,9 +299,11 @@ class CORE_EXPORT QgsSymbolV2RenderContext }; + ////////////////////// + class CORE_EXPORT QgsMarkerSymbolV2 : public QgsSymbolV2 { public: