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 mLightAzimuth_updated( 315.00 );
40 mZFactor->setValue( 1 );
41 mZFactor->setClearValue( 1 );
43 mMultiDirection->setChecked(
false );
49 connect( mLightAzimuth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHillshadeRendererWidget::mLightAzimuth_updated );
50 connect( mLightAzimuthDial, &QAbstractSlider::valueChanged,
this, &QgsHillshadeRendererWidget::mLightAzimuthDial_updated );
69 int band = mBandsCombo->currentBand();
71 double value = mZFactor->value();
83 mLightAngle->setValue( r->
altitude() );
84 mLightAzimuth->setValue( r->
azimuth() );
85 mZFactor->setValue( r->
zFactor() );
92 mLightAngle->setValue( altitude );
97 mLightAzimuth->setValue( azimuth );
102 mZFactor->setValue( zfactor );
107 mMultiDirection->setChecked( isMultiDirectional );
110 void QgsHillshadeRendererWidget::mLightAzimuth_updated(
double value )
112 int newvalue =
static_cast<int>( value ) - 180;
119 void QgsHillshadeRendererWidget::mLightAzimuthDial_updated(
int value )
121 int newvalue =
static_cast<int>( value ) + 180;
122 if ( newvalue > 360 )
130 return mLightAzimuth->value();
135 return mLightAngle->value();
140 return mZFactor->value();
145 return mMultiDirection->isChecked();
int band() const
Returns the band used by the renderer.
A rectangle specified with double values.
void setMultiDirectional(bool isMultiDirectional)
Sets whether to render using a multi-directional hillshade algorithm.
double altitude() const
Returns the angle of the light source over the raster.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
void setBand(int bandNo)
Sets the band used by the renderer.
void setZFactor(double zfactor)
Set the Z scaling factor of the result image.
QgsRasterDataProvider * dataProvider() override
Returns the layer's data provider.
QgsRasterRenderer * renderer() const
void bandChanged(int band)
This signal is emitted when the currently selected band changes.
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 azimuth() const
Returns the direction of the light over the raster between 0-360.
bool multiDirectional() const
Returns true if the renderer is using multi-directional hillshading.
double zFactor() const
Returns the Z scaling factor.
Raster renderer pipe that applies colors to a raster.
Base class for raster data providers.