33 QGridLayout *layout =
new QGridLayout(
this );
34 QLabel *label =
new QLabel( tr(
"The 2.5D renderer only can be used with polygon layers. \n"
35 "'%1' is not a polygon layer and cannot be rendered in 2.5D." )
36 .arg( layer->
name() ),
this );
37 layout->addWidget( label );
42 this->layout()->setContentsMargins( 0, 0, 0, 0 );
44 mAngleWidget->setClearValue( 0 );
45 mWallColorButton->setColorDialogTitle( tr(
"Select Wall Color" ) );
46 mWallColorButton->setAllowOpacity(
true );
47 mWallColorButton->setContext( QStringLiteral(
"symbology" ) );
48 mRoofColorButton->setColorDialogTitle( tr(
"Select Roof Color" ) );
49 mRoofColorButton->setAllowOpacity(
true );
50 mRoofColorButton->setContext( QStringLiteral(
"symbology" ) );
51 mShadowColorButton->setColorDialogTitle( tr(
"Select Shadow Color" ) );
52 mShadowColorButton->setAllowOpacity(
true );
53 mShadowColorButton->setContext( QStringLiteral(
"symbology" ) );
60 mHeightWidget->setLayer( layer );
63 QVariant height = scope->
variable( QStringLiteral(
"qgis_25d_height" ) );
64 QVariant
angle = scope->
variable( QStringLiteral(
"qgis_25d_angle" ) );
67 mHeightWidget->setField( height.isNull() ? QStringLiteral(
"10" ) : height.toString() );
68 mAngleWidget->setValue(
angle.isNull() ? 70 :
angle.toDouble() );
69 mAngleWidget->setClearValue( 70 );
70 mWallColorButton->setColor( mRenderer->
wallColor() );
71 mRoofColorButton->setColor( mRenderer->
roofColor() );
72 mShadowColorButton->setColor( mRenderer->
shadowColor() );
73 mShadowEnabledWidget->setChecked( mRenderer->
shadowEnabled() );
74 mShadowSizeWidget->setValue( mRenderer->
shadowSpread() );
75 mShadowSizeWidget->setClearValue( 4 );
78 connect( mAngleWidget,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &Qgs25DRendererWidget::updateRenderer );
83 connect( mShadowEnabledWidget, &QGroupBox::toggled,
this, &Qgs25DRendererWidget::updateRenderer );
84 connect( mShadowSizeWidget,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &Qgs25DRendererWidget::updateRenderer );
85 connect( mWallExpositionShading, &QAbstractButton::toggled,
this, &Qgs25DRendererWidget::updateRenderer );
93 void Qgs25DRendererWidget::updateRenderer()
104 void Qgs25DRendererWidget::apply()
QColor roofColor() const
Gets the roof color.
void setWallColor(const QColor &wallColor)
Set the wall color.
QColor shadowColor() const
Gets the shadow's color.
static Qgs25DRenderer * convertFromRenderer(QgsFeatureRenderer *renderer)
Try to convert from an existing renderer.
double shadowSpread() const
Gets the shadow's spread distance in map units.
void setWallShadingEnabled(bool enabled)
Set wall shading enabled.
void setRoofColor(const QColor &roofColor)
Set the roof color.
void setShadowEnabled(bool value)
Enable or disable the shadow.
bool wallShadingEnabled() const
Gets wall shading enabled.
bool shadowEnabled() const
Is the shadow enabled.
QColor wallColor() const
Gets the wall color.
void setShadowColor(const QColor &shadowColor)
Set the shadow's color.
void setShadowSpread(double shadowSpread)
Set the shadow's spread distance in map units.
Single scope for storing variables and functions for use within a QgsExpressionContext.
QVariant variable(const QString &name) const
Retrieves a variable's value from the scope.
static void setLayerVariable(QgsMapLayer *layer, const QString &name, const QVariant &value)
Sets a layer context variable.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)