22 , mRenderer( nullptr )
32 QLabel* label =
new QLabel(
tr(
"The 2.5D renderer only can be used with polygon layers. \n" 33 "'%1' is not a polygon layer and cannot be rendered in 2.5D." )
34 .arg( layer->
name() ),
this );
46 mHeightWidget->setLayer( layer );
53 mHeightWidget->setField( height.
isNull() ?
"10" : height.
toString() );
55 mWallColorButton->setColor( mRenderer->
wallColor() );
56 mRoofColorButton->setColor( mRenderer->
roofColor() );
57 mShadowColorButton->setColor( mRenderer->
shadowColor() );
58 mShadowEnabledWidget->setChecked( mRenderer->
shadowEnabled() );
59 mShadowSizeWidget->setValue( mRenderer->
shadowSpread() );
62 connect( mAngleWidget, SIGNAL( valueChanged(
int ) ),
this, SLOT( updateRenderer() ) );
63 connect( mHeightWidget, SIGNAL( fieldChanged(
QString ) ),
this, SLOT( updateRenderer() ) );
64 connect( mWallColorButton, SIGNAL( colorChanged(
QColor ) ),
this, SLOT( updateRenderer() ) );
65 connect( mRoofColorButton, SIGNAL( colorChanged(
QColor ) ),
this, SLOT( updateRenderer() ) );
66 connect( mShadowColorButton, SIGNAL( colorChanged(
QColor ) ),
this, SLOT( updateRenderer() ) );
67 connect( mShadowEnabledWidget, SIGNAL( toggled(
bool ) ),
this, SLOT( updateRenderer() ) );
68 connect( mShadowSizeWidget, SIGNAL( valueChanged(
double ) ),
this, SLOT( updateRenderer() ) );
69 connect( mWallExpositionShading, SIGNAL( toggled(
bool ) ),
this, SLOT( updateRenderer() ) );
77 void Qgs25DRendererWidget::updateRenderer()
87 void Qgs25DRendererWidget::apply()
QColor shadowColor() const
Get the shadow's color.
bool wallShadingEnabled()
Get wall shading enabled.
QString name() const
Get the display name of the layer.
static Qgs25DRenderer * convertFromRenderer(QgsFeatureRendererV2 *renderer)
Try to convert from an existing renderer.
QString tr(const char *sourceText, const char *disambiguation, int n)
QColor wallColor() const
Get the wall color.
void setShadowSpread(double shadowSpread)
Set the shadow's spread distance in map units.
QGis::GeometryType geometryType() const
Returns point, line or polygon.
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.
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QColor roofColor() const
Get the roof color.
void setRoofColor(const QColor &roofColor)
Set the roof color.
void setShadowEnabled(bool value)
Enable or disable the shadow.
void setWallShadingEnabled(bool enabled)
Set wall shading enabled.
double toDouble(bool *ok) const
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
void setShadowColor(const QColor &shadowColor)
Set the shadow's color.
void setWallColor(const QColor &wallColor)
Set the wall color.
double shadowSpread() const
Get the shadow's spread distance in map units.
bool shadowEnabled() const
Is the shadow enabled.