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 const int band = mBandsCombo->currentBand();
71 const double value = mZFactor->value();
73 renderer->setMultiDirectional( mMultiDirection->checkState() );
83 mLightAngle->setValue( r->
altitude() );
84 mLightAzimuth->setValue( r->
azimuth() );
85 mZFactor->setValue( r->
zFactor() );
97 mLightAzimuth->setValue(
azimuth );
102 mZFactor->setValue( zfactor );
107 mMultiDirection->setChecked( isMultiDirectional );
110void QgsHillshadeRendererWidget::mLightAzimuth_updated(
double value )
112 int newvalue =
static_cast<int>( value ) - 180;
119void 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();
A renderer for generating live hillshade models.
bool multiDirectional() const
Returns true if the renderer is using multi-directional hillshading.
double azimuth() const
Returns the direction of the light over the raster between 0-360.
int band() const
Returns the band used by the renderer.
void setBand(int bandNo)
Sets the band used by the renderer.
double altitude() const
Returns the angle of the light source over the raster.
double zFactor() const
Returns the Z scaling factor.
void bandChanged(int band)
Emitted when the currently selected band changes.
Base class for raster data providers.
Represents a raster layer.
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
Raster renderer pipe that applies colors to a raster.
A rectangle specified with double values.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.