26#include "moc_qgshillshaderendererwidget.cpp"
33 mLightAngle->setMaximum( 90 );
34 mLightAzimuth->setMaximum( 360.00 );
36 mLightAngle->setValue( 45.00 );
37 mLightAngle->setClearValue( 45.0 );
38 mLightAzimuth->setValue( 315.00 );
39 mLightAzimuth->setClearValue( 315.00 );
42 mLightAzimuth_updated( 315.00 );
43 mZFactor->setValue( 1 );
44 mZFactor->setClearValue( 1 );
46 mMultiDirection->setChecked(
false );
52 connect( mLightAzimuth,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHillshadeRendererWidget::mLightAzimuth_updated );
53 connect( mLightAzimuthDial, &QAbstractSlider::valueChanged,
this, &QgsHillshadeRendererWidget::mLightAzimuthDial_updated );
72 const int band = mBandsCombo->currentBand();
74 const double value = mZFactor->value();
76 renderer->setMultiDirectional( mMultiDirection->checkState() );
86 mLightAngle->setValue( r->
altitude() );
87 mLightAzimuth->setValue( r->
azimuth() );
88 mZFactor->setValue( r->
zFactor() );
100 mLightAzimuth->setValue(
azimuth );
105 mZFactor->setValue( zfactor );
110 mMultiDirection->setChecked( isMultiDirectional );
113void QgsHillshadeRendererWidget::mLightAzimuth_updated(
double value )
115 int newvalue =
static_cast<int>( value ) - 180;
122void QgsHillshadeRendererWidget::mLightAzimuthDial_updated(
int value )
124 int newvalue =
static_cast<int>( value ) + 180;
125 if ( newvalue > 360 )
133 return mLightAzimuth->value();
138 return mLightAngle->value();
143 return mZFactor->value();
148 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 inputBand() const override
Returns the input band for the renderer, or -1 if no input band is available.
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.
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.