30 mLightAngle->setMaximum( 90 );
31 mLightAzimuth->setMaximum( 360.00 );
33 mLightAngle->setValue( 45.00 );
34 mLightAngle->setClearValue( 45.0 );
35 mLightAzimuth->setValue( 315.00 );
36 mLightAzimuth->setClearValue( 315.00 );
39 on_mLightAzimuth_updated( 315.00 );
40 mZFactor->setValue( 1 );
41 mZFactor->setClearValue( 1 );
43 mMultiDirection->setChecked(
false );
55 for (
int i = 1; i <= nBands; ++i )
65 connect( mLightAzimuth, SIGNAL( valueChanged(
double ) ),
this, SLOT( on_mLightAzimuth_updated(
double ) ) );
66 connect( mLightAzimuthDial, SIGNAL( valueChanged(
int ) ),
this, SLOT( on_mLightAzimuthDail_updated(
int ) ) );
89 int band = mBandsCombo->itemData( mBandsCombo->currentIndex() ).toInt();
91 double value = mZFactor->value();
102 mBandsCombo->setCurrentIndex( mBandsCombo->findData( r->
band() ) );
103 mLightAngle->setValue( r->
altitude() );
104 mLightAzimuth->setValue( r->
azimuth() );
105 mZFactor->setValue( r->
zFactor() );
112 mLightAngle->setValue( altitude );
117 mLightAzimuth->setValue( azimuth );
122 mZFactor->setValue( zfactor );
127 mMultiDirection->setChecked( isMultiDirectional );
130 void QgsHillshadeRendererWidget::on_mLightAzimuth_updated(
double value )
132 int newvalue = ( int )value - 180;
139 void QgsHillshadeRendererWidget::on_mLightAzimuthDail_updated(
int value )
141 int newvalue = ( int )value + 180;
142 if ( newvalue > 360 )
150 return mLightAzimuth->value();
155 return mLightAngle->value();
160 return mZFactor->value();
165 return mMultiDirection->isChecked();
virtual int bandCount() const =0
Get number of bands.
A rectangle specified with double values.
void setMultiDirectional(bool isMultiDirectional)
Sets whether to render using a multi-directional hillshade algorithm.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsRasterRenderer * renderer() const
void setZFactor(double zfactor)
Set the Z scaling factor of the result image.
int band() const
Returns the band used by the renderer.
bool multiDirectional() const
Returns true if the renderer is using multi-directional hillshading.
A renderer for generating live hillshade models.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
double altitude() const
Returns the angle of the light source over the raster.
QgsRasterDataProvider * dataProvider()
Returns the data provider.
double zFactor() const
Returns the Z scaling factor.
double azimuth() const
Returns the direction of the light over the raster between 0-360.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Raster renderer pipe that applies colors to a raster.
Base class for raster data providers.