Skip to content
Permalink
Browse files
reverse sipify override methods
  • Loading branch information
3nids committed May 23, 2017
1 parent 00fcc6e commit 8d2f42af2d7cc4f5292883324a7e15312a25aa39
Showing with 76 additions and 61 deletions.
  1. +12 −5 scripts/sipify_header.sh
  2. +2 −2 src/analysis/interpolation/DualEdgeTriangulation.h
  3. +3 −2 src/analysis/interpolation/TriDecorator.h
  4. +1 −1 src/core/composer/qgscomposerattributetablev2.h
  5. +1 −1 src/core/composer/qgscomposerhtml.h
  6. +2 −1 src/core/diagram/qgshistogramdiagram.h
  7. +2 −1 src/core/diagram/qgspiediagram.h
  8. +2 −1 src/core/diagram/qgstextdiagram.h
  9. +1 −1 src/core/effects/qgsblureffect.h
  10. +1 −1 src/core/effects/qgscoloreffect.h
  11. +1 −1 src/core/effects/qgseffectstack.h
  12. +2 −2 src/core/effects/qgsgloweffect.h
  13. +1 −1 src/core/effects/qgspainteffect.h
  14. +2 −2 src/core/effects/qgsshadoweffect.h
  15. +1 −1 src/core/effects/qgstransformeffect.h
  16. +2 −2 src/core/qgsdiagramrenderer.h
  17. +2 −1 src/core/raster/qgsbrightnesscontrastfilter.h
  18. +1 −1 src/core/raster/qgscolorrampshader.h
  19. +2 −1 src/core/raster/qgshuesaturationfilter.h
  20. +1 −1 src/core/raster/qgsmultibandcolorrenderer.h
  21. +2 −2 src/core/raster/qgspalettedrasterrenderer.h
  22. +1 −1 src/core/raster/qgsrasterlayer.h
  23. +1 −1 src/core/raster/qgsrasterresamplefilter.h
  24. +1 −1 src/core/raster/qgssinglebandgrayrenderer.h
  25. +1 −1 src/core/raster/qgssinglebandpseudocolorrenderer.h
  26. +2 −2 src/core/symbology-ng/qgsarrowsymbollayer.h
  27. +2 −2 src/core/symbology-ng/qgscategorizedsymbolrenderer.h
  28. +5 −5 src/core/symbology-ng/qgsfillsymbollayer.h
  29. +2 −2 src/core/symbology-ng/qgsgraduatedsymbolrenderer.h
  30. +1 −1 src/core/symbology-ng/qgsheatmaprenderer.h
  31. +2 −2 src/core/symbology-ng/qgsinvertedpolygonrenderer.h
  32. +1 −1 src/core/symbology-ng/qgsmarkersymbollayer.h
  33. +1 −1 src/core/symbology-ng/qgsnullsymbolrenderer.h
  34. +3 −2 src/core/symbology-ng/qgspointdistancerenderer.h
  35. +2 −2 src/core/symbology-ng/qgsrulebasedrenderer.h
  36. +2 −2 src/core/symbology-ng/qgssinglesymbolrenderer.h
  37. +3 −3 src/core/symbology-ng/qgssymbol.h
  38. +2 −1 src/core/symbology-ng/qgsvectorfieldsymbollayer.h
@@ -66,18 +66,25 @@ while read -r sipfile; do
dest_line=$(${GP}sed -r "s@/${annot_head[$i]}/@${annot_sip[$i]}@g" <<< $line)
esc_orig_line=$(${GP}sed -r 's/([(){}*+?$^&])/\\\1/g' <<< $orig_line)
esc_dest_line=$(${GP}sed -r 's/([&])/\\\1/g' <<< $dest_line)
esc_orig_line=$(${GP}sed -r 's/0/(0|nullptr)/g' <<< $esc_orig_line)
esc_orig_line=$(${GP}sed -r 's/0/(\?:0|nullptr)/g' <<< $esc_orig_line)
esc_orig_line=$(${GP}sed -r 's/""/(""|QString\(\))/g' <<< $esc_orig_line)
esc_dest_line=$(${GP}sed -r 's/(\*\w+) = 0/\1 = nullptr/g' <<< $esc_dest_line)
echo $esc_orig_line
echo $esc_dest_line
esc_orig_line=$(${GP}sed -r 's/((= 0)?;)/\(\\s\*override\)\?\\s\*\1/g' <<< $esc_orig_line)
esc_dest_line=$(${GP}sed -r 's/(( SIP_\w+)?( = 0)?;)/\\1\1/' <<< $esc_dest_line)
echo "orig: $esc_orig_line"
echo "dest: $esc_dest_line"
#echo "${GP}sed -i -r \"s/$esc_orig_line/$esc_dest_line/\" $header"
${GP}sed -i -r "s/$esc_orig_line/$esc_dest_line/" $header
perl -pi.bak -e "s/$esc_orig_line/$esc_dest_line/" $header
done < <(egrep "\/${annot_head[$i]}\/" python/$sipfile)
done

# if [[ $sipfile =~ core/diagram/qgshistogramdiagram.sip ]]; then
# exit
# fi


if ! cmp $header $m >/dev/null 2>&1; then
if ! grep -xq "#include \"qgis.h\"" $header; then
if ! egrep -xq "#include \"qgis(_sip)?.h\"" $header; then
gawk -i inplace '{print} /^#include/ && !n {print "#include \"qgis.h\""; n++}' $header
fi
fi
@@ -44,7 +44,7 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
virtual ~DualEdgeTriangulation();
void setDecorator( Triangulation *d ) {mDecorator = d;}
//! Adds a line (e.g. a break-, structure- or an isoline) to the triangulation. The class takes ownership of the line object and its points
void addLine( Line3D *line, bool breakline ) override;
void addLine( Line3D *line SIP_TRANSFER, bool breakline ) override;
//! Adds a point to the triangulation and returns the number of this point in case of success or -100 in case of failure
int addPoint( Point3D *p ) override;
//! Performs a consistency check, remove this later
@@ -63,7 +63,7 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
//! \note not available in Python bindings
virtual bool getTriangle( double x, double y, Point3D *p1, int *n1, Point3D *p2, int *n2, Point3D *p3, int *n3 ) override SIP_SKIP;
//! Finds out, in which triangle the point with coordinates x and y is and assigns addresses to the points at the vertices to 'p1', 'p2' and 'p3
virtual bool getTriangle( double x, double y, Point3D *p1, Point3D *p2, Point3D *p3 ) override;
virtual bool getTriangle( double x, double y, Point3D *p1 SIP_OUT, Point3D *p2 SIP_OUT, Point3D *p3 SIP_OUT ) override;
//! Returns a pointer to a value list with the information of the triangles surrounding (counterclockwise) a point. Four integer values describe a triangle, the first three are the number of the half edges of the triangle and the fourth is -10, if the third (and most counterclockwise) edge is a breakline, and -20 otherwise. The value list has to be deleted by the code which called the method
QList<int> *getSurroundingTriangles( int pointno ) override;
//! Returns the largest x-coordinate value of the bounding box
@@ -18,6 +18,7 @@
#define TRIDECORATOR_H

#include "Triangulation.h"
#include "qgis.h"
#include "qgis_analysis.h"

/** \ingroup analysis
@@ -38,8 +39,8 @@ class ANALYSIS_EXPORT TriDecorator : public Triangulation
virtual bool calcPoint( double x, double y, Point3D *result ) override;
virtual Point3D *getPoint( unsigned int i ) const override;
virtual int getNumberOfPoints() const override;
bool getTriangle( double x, double y, Point3D *p1, int *n1, Point3D *p2, int *n2, Point3D *p3, int *n3 ) override;
bool getTriangle( double x, double y, Point3D *p1, Point3D *p2, Point3D *p3 ) override;
bool getTriangle( double x, double y, Point3D *p1, int *n1 SIP_OUT, Point3D *p2 SIP_OUT, int *n2 SIP_OUT, Point3D *p3 SIP_OUT, int *n3 SIP_OUT ) override;
bool getTriangle( double x, double y, Point3D *p1 SIP_OUT, Point3D *p2 SIP_OUT, Point3D *p3 SIP_OUT ) override;
virtual int getOppositePoint( int p1, int p2 ) override;
virtual QList<int> *getSurroundingTriangles( int pointno ) override;
virtual double getXMax() const override;
@@ -90,7 +90,7 @@ class CORE_EXPORT QgsComposerAttributeTableV2: public QgsComposerTableV2
*/
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false ) override;

virtual void addFrame( QgsComposerFrame *frame, bool recalcFrameSizes = true ) override;
virtual void addFrame( QgsComposerFrame *frame SIP_TRANSFER, bool recalcFrameSizes = true ) override;

/** Sets the source for attributes to show in table body.
* \param source content source
@@ -206,7 +206,7 @@ class CORE_EXPORT QgsComposerHtml: public QgsComposerMultiFrame
void render( QPainter *p, const QRectF &renderExtent, const int frameIndex ) override;
bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const override;
bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false ) override;
void addFrame( QgsComposerFrame *frame, bool recalcFrameSizes = true ) override;
void addFrame( QgsComposerFrame *frame SIP_TRANSFER, bool recalcFrameSizes = true ) override;
//overridden to break frames without dividing lines of text
double findNearbyPageBreak( double yPos ) override;

@@ -19,6 +19,7 @@
#define DIAGRAM_NAME_HISTOGRAM "Histogram"

#include "qgis_core.h"
#include "qgis.h"
#include "qgsdiagram.h"
#include <QPen>
#include <QBrush>
@@ -39,7 +40,7 @@ class CORE_EXPORT QgsHistogramDiagram: public QgsDiagram
public:
QgsHistogramDiagram();

virtual QgsHistogramDiagram *clone() const override;
virtual QgsHistogramDiagram *clone() const override SIP_FACTORY;

void renderDiagram( const QgsFeature &feature, QgsRenderContext &c, const QgsDiagramSettings &s, QPointF position ) override;

@@ -18,6 +18,7 @@
#define DIAGRAM_NAME_PIE "Pie"

#include "qgis_core.h"
#include "qgis.h"
#include "qgsdiagram.h"
#include <QPen>
#include <QBrush>
@@ -37,7 +38,7 @@ class CORE_EXPORT QgsPieDiagram: public QgsDiagram
public:
QgsPieDiagram();

virtual QgsPieDiagram *clone() const override;
virtual QgsPieDiagram *clone() const override SIP_FACTORY;

void renderDiagram( const QgsFeature &feature, QgsRenderContext &c, const QgsDiagramSettings &s, QPointF position ) override;

@@ -18,6 +18,7 @@
#define DIAGRAM_NAME_TEXT "Text"

#include "qgis_core.h"
#include "qgis.h"
#include "qgsdiagram.h"
#include <QPen>
#include <QBrush>
@@ -49,7 +50,7 @@ class CORE_EXPORT QgsTextDiagram: public QgsDiagram
};

QgsTextDiagram();
virtual QgsTextDiagram *clone() const override;
virtual QgsTextDiagram *clone() const override SIP_FACTORY;

void renderDiagram( const QgsFeature &feature, QgsRenderContext &c, const QgsDiagramSettings &s, QPointF position ) override;

@@ -53,7 +53,7 @@ class CORE_EXPORT QgsBlurEffect : public QgsPaintEffect
virtual QString type() const override { return QStringLiteral( "blur" ); }
virtual QgsStringMap properties() const override;
virtual void readProperties( const QgsStringMap &props ) override;
virtual QgsBlurEffect *clone() const override;
virtual QgsBlurEffect *clone() const override SIP_FACTORY;

/** Sets blur level (strength)
* \param level blur level. Depending on the current blurMethod(), this parameter
@@ -47,7 +47,7 @@ class CORE_EXPORT QgsColorEffect : public QgsPaintEffect
virtual QString type() const override { return QStringLiteral( "color" ); }
virtual QgsStringMap properties() const override;
virtual void readProperties( const QgsStringMap &props ) override;
virtual QgsColorEffect *clone() const override;
virtual QgsColorEffect *clone() const override SIP_FACTORY;

/** Sets the brightness modification for the effect.
* \param brightness Valid values are between -255 and 255, where 0 represents
@@ -65,7 +65,7 @@ class CORE_EXPORT QgsEffectStack : public QgsPaintEffect
virtual ~QgsEffectStack();

virtual QString type() const override { return QStringLiteral( "effectStack" ); }
virtual QgsEffectStack *clone() const override;
virtual QgsEffectStack *clone() const override SIP_FACTORY;
virtual bool saveProperties( QDomDocument &doc, QDomElement &element ) const override;
virtual bool readProperties( const QDomElement &element ) override;

@@ -245,7 +245,7 @@ class CORE_EXPORT QgsOuterGlowEffect : public QgsGlowEffect
QgsOuterGlowEffect();

virtual QString type() const override { return QStringLiteral( "outerGlow" ); }
virtual QgsOuterGlowEffect *clone() const override;
virtual QgsOuterGlowEffect *clone() const override SIP_FACTORY;

protected:

@@ -275,7 +275,7 @@ class CORE_EXPORT QgsInnerGlowEffect : public QgsGlowEffect
QgsInnerGlowEffect();

virtual QString type() const override { return QStringLiteral( "innerGlow" ); }
virtual QgsInnerGlowEffect *clone() const override;
virtual QgsInnerGlowEffect *clone() const override SIP_FACTORY;

protected:

@@ -267,7 +267,7 @@ class CORE_EXPORT QgsDrawSourceEffect : public QgsPaintEffect
static QgsPaintEffect *create( const QgsStringMap &map ) SIP_FACTORY;

virtual QString type() const override { return QStringLiteral( "drawSource" ); }
virtual QgsDrawSourceEffect *clone() const override;
virtual QgsDrawSourceEffect *clone() const override SIP_FACTORY;
virtual QgsStringMap properties() const override;
virtual void readProperties( const QgsStringMap &props ) override;

@@ -200,7 +200,7 @@ class CORE_EXPORT QgsDropShadowEffect : public QgsShadowEffect
QgsDropShadowEffect();

virtual QString type() const override;
virtual QgsDropShadowEffect *clone() const override;
virtual QgsDropShadowEffect *clone() const override SIP_FACTORY;

protected:

@@ -229,7 +229,7 @@ class CORE_EXPORT QgsInnerShadowEffect : public QgsShadowEffect
QgsInnerShadowEffect();

virtual QString type() const override;
virtual QgsInnerShadowEffect *clone() const override;
virtual QgsInnerShadowEffect *clone() const override SIP_FACTORY;

protected:

@@ -48,7 +48,7 @@ class CORE_EXPORT QgsTransformEffect : public QgsPaintEffect
virtual QString type() const override { return QStringLiteral( "transform" ); }
virtual QgsStringMap properties() const override;
virtual void readProperties( const QgsStringMap &props ) override;
virtual QgsTransformEffect *clone() const override;
virtual QgsTransformEffect *clone() const override SIP_FACTORY;

/** Sets the transform x translation.
* \param translateX distance to translate along the x axis
@@ -632,7 +632,7 @@ class CORE_EXPORT QgsSingleCategoryDiagramRenderer : public QgsDiagramRenderer
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const override;

QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override;
QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override SIP_FACTORY;

protected:
bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const override;
@@ -699,7 +699,7 @@ class CORE_EXPORT QgsLinearlyInterpolatedDiagramRenderer : public QgsDiagramRend
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context ) const override;

QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override;
QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const override SIP_FACTORY;

protected:
bool diagramSettings( const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s ) const override;
@@ -19,6 +19,7 @@
#define QGSBRIGHTNESSCONTRASTFILTER_H

#include "qgis_core.h"
#include "qgis.h"
#include "qgsrasterinterface.h"

class QDomElement;
@@ -39,7 +40,7 @@ class CORE_EXPORT QgsBrightnessContrastFilter : public QgsRasterInterface

bool setInput( QgsRasterInterface *input ) override;

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;

void setBrightness( int brightness ) { mBrightness = qBound( -255, brightness, 255 ); }
int brightness() const { return mBrightness; }
@@ -149,7 +149,7 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
bool shade( double, double, double, double, int *, int *, int *, int * ) override;

//! \brief Get symbology items if provided by renderer
void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems ) const override;
void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const override;

//! Sets classification mode
void setClassificationMode( ClassificationMode classificationMode ) { mClassificationMode = classificationMode; }
@@ -19,6 +19,7 @@
#define QGSHUESATURATIONFILTER_H

#include "qgis_core.h"
#include "qgis.h"
#include "qgsrasterinterface.h"

class QDomElement;
@@ -49,7 +50,7 @@ class CORE_EXPORT QgsHueSaturationFilter : public QgsRasterInterface

bool setInput( QgsRasterInterface *input ) override;

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;

void setSaturation( int saturation );
int saturation() const { return mSaturation; }
@@ -45,7 +45,7 @@ class CORE_EXPORT QgsMultiBandColorRenderer: public QgsRasterRenderer

static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input );

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;

int redBand() const { return mRedBand; }
void setRedBand( int band ) { mRedBand = band; }
@@ -70,7 +70,7 @@ class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer
QgsPalettedRasterRenderer *clone() const override;
static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) SIP_FACTORY;

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;

//! Returns number of colors
int nColors() const { return mClassData.size(); }
@@ -90,7 +90,7 @@ class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer

void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;

void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems ) const override;
void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const override;

QList<int> usesBands() const override;

@@ -269,7 +269,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** Return new instance of QgsMapLayerRenderer that will be used for rendering of given context
* \since QGIS 2.4
*/
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override;
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;

//! \brief This is an overloaded version of the draw() function that is called by both draw() and thumbnailAsPixmap
void draw( QPainter *theQPainter,
@@ -41,7 +41,7 @@ class CORE_EXPORT QgsRasterResampleFilter : public QgsRasterInterface

bool setInput( QgsRasterInterface *input ) override;

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;

//! Set resampler for zoomed in scales. Takes ownership of the object
void setZoomedInResampler( QgsRasterResampler *r SIP_TRANSFER );
@@ -62,7 +62,7 @@ class CORE_EXPORT QgsSingleBandGrayRenderer: public QgsRasterRenderer

void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;

void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems ) const override;
void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const override;

QList<int> usesBands() const override;

@@ -71,7 +71,7 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer

void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;

void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems ) const override;
void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const override;

QList<int> usesBands() const override;

@@ -42,9 +42,9 @@ class CORE_EXPORT QgsArrowSymbolLayer : public QgsLineSymbolLayer
*/
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

virtual QgsArrowSymbolLayer *clone() const override;
virtual QgsArrowSymbolLayer *clone() const override SIP_FACTORY;
virtual QgsSymbol *subSymbol() override { return mSymbol.get(); }
virtual bool setSubSymbol( QgsSymbol *symbol ) override;
virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;

//! Get current arrow width

0 comments on commit 8d2f42a

Please sign in to comment.