Skip to content

Commit

Permalink
sip updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 6, 2012
1 parent 41d306b commit 9fb3111
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
10 changes: 10 additions & 0 deletions python/core/raster/qgsrasterrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@ class QgsRasterRenderer : QgsRasterInterface

/**Returns a list of band numbers used by the renderer*/
virtual QList<int> usesBands() const;

static QString minMaxOriginName( int theOrigin );
static QString minMaxOriginLabel( int theOrigin );
static int minMaxOriginFromName( QString theName );

protected:

/**Write upper class info into rasterrenderer element (called by writeXML method of subclasses)*/
void _writeXML( QDomDocument& doc, QDomElement& rasterRendererElem ) const;

};
16 changes: 15 additions & 1 deletion python/core/raster/qgssinglebandpseudocolorrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
/**Note: takes ownership of QgsRasterShader*/
QgsSingleBandPseudoColorRenderer( QgsRasterDataProvider* provider, int band, QgsRasterShader* shader /Transfer/ );
~QgsSingleBandPseudoColorRenderer();
QgsRasterInterface * clone() /Factory/;
QgsRasterInterface * clone() const /Factory/;

static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider ) /Factory/;

Expand All @@ -16,8 +16,22 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
/**Takes ownership of the shader*/
void setShader( QgsRasterShader* shader /Transfer/ );
QgsRasterShader* shader();
const QgsRasterShader* constShader() const;
%MethodCode
sipRes = sipCpp->shader();
%End

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

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

QList<int> usesBands() const;

double classificationMin() const;
double classificationMax() const;
void setClassificationMin( double min );
void setClassificationMax( double max );
int classificationMinMaxOrigin() const;
void setClassificationMinMaxOrigin( int origin );

};
2 changes: 1 addition & 1 deletion python/gui/raster/qgsrasterminmaxwidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ class QgsRasterMinMaxWidget: QWidget
void setBands( const QList<int> & theBands );

signals:
void load( int theBandNo, double theMin, double theMax );
void load( int theBandNo, double theMin, double theMax, int origin );
};
4 changes: 4 additions & 0 deletions python/gui/raster/qgssinglebandpseudocolorrendererwidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ class QgsSingleBandPseudoColorRendererWidget : QgsRasterRendererWidget
QgsRasterRenderer* renderer();

void setFromRenderer( const QgsRasterRenderer* r );

public slots:
void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );

};
2 changes: 1 addition & 1 deletion src/core/raster/qgssinglebandpseudocolorrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer

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

void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );

/**Takes ownership of the shader*/
void setShader( QgsRasterShader* shader );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/raster/qgssinglebandpseudocolorrendererwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere

void setFromRenderer( const QgsRasterRenderer* r );

private:
void populateColormapTreeWidget( const QList<QgsColorRampShader::ColorRampItem>& colorRampItems );

public slots:
void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );

private:
void populateColormapTreeWidget( const QList<QgsColorRampShader::ColorRampItem>& colorRampItems );

private slots:
void on_mAddEntryButton_clicked();
void on_mDeleteEntryButton_clicked();
Expand Down

0 comments on commit 9fb3111

Please sign in to comment.