20#include "moc_qgshillshaderendererwidget.cpp" 
   31  mLightAngle->setMaximum( 90 );
 
   32  mLightAzimuth->setMaximum( 360.00 );
 
   34  mLightAngle->setValue( 45.00 );
 
   35  mLightAngle->setClearValue( 45.0 );
 
   36  mLightAzimuth->setValue( 315.00 );
 
   37  mLightAzimuth->setClearValue( 315.00 );
 
   40  mLightAzimuth_updated( 315.00 );
 
   41  mZFactor->setValue( 1 );
 
   42  mZFactor->setClearValue( 1 );
 
   44  mMultiDirection->setChecked( 
false );
 
   50  connect( mLightAzimuth, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsHillshadeRendererWidget::mLightAzimuth_updated );
 
   51  connect( mLightAzimuthDial, &QAbstractSlider::valueChanged, 
this, &QgsHillshadeRendererWidget::mLightAzimuthDial_updated );
 
 
   70  const int band = mBandsCombo->currentBand();
 
   72  const double value = mZFactor->value();
 
   74  renderer->setMultiDirectional( mMultiDirection->checkState() );
 
 
   84    mLightAngle->setValue( r->
altitude() );
 
   85    mLightAzimuth->setValue( r->
azimuth() );
 
   86    mZFactor->setValue( r->
zFactor() );
 
 
   98  mLightAzimuth->setValue( 
azimuth );
 
 
  103  mZFactor->setValue( zfactor );
 
 
  108  mMultiDirection->setChecked( isMultiDirectional );
 
 
  111void QgsHillshadeRendererWidget::mLightAzimuth_updated( 
double value )
 
  113  int newvalue = 
static_cast<int>( value ) - 180;
 
  120void QgsHillshadeRendererWidget::mLightAzimuthDial_updated( 
int value )
 
  122  int newvalue = 
static_cast<int>( value ) + 180;
 
  123  if ( newvalue > 360 )
 
  131  return mLightAzimuth->value();
 
 
  136  return mLightAngle->value();
 
 
  141  return mZFactor->value();
 
 
  146  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.
 
Q_DECL_DEPRECATED void setBand(int bandNo)
Sets the band used by the renderer.
 
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.
 
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.