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 );
41 mWallColorButton->setColorDialogTitle(
tr(
"Select wall color" ) );
42 mWallColorButton->setAllowAlpha(
true );
43 mWallColorButton->setContext(
"symbology" );
44 mRoofColorButton->setColorDialogTitle(
tr(
"Select roof color" ) );
45 mRoofColorButton->setAllowAlpha(
true );
46 mRoofColorButton->setContext(
"symbology" );
47 mShadowColorButton->setColorDialogTitle(
tr(
"Select shadow color" ) );
48 mShadowColorButton->setAllowAlpha(
true );
49 mShadowColorButton->setContext(
"symbology" );
56 mHeightWidget->setLayer( layer );
63 mHeightWidget->setField( height.
isNull() ?
"10" : height.
toString() );
65 mWallColorButton->setColor( mRenderer->
wallColor() );
66 mRoofColorButton->setColor( mRenderer->
roofColor() );
67 mShadowColorButton->setColor( mRenderer->
shadowColor() );
68 mShadowEnabledWidget->setChecked( mRenderer->
shadowEnabled() );
69 mShadowSizeWidget->setValue( mRenderer->
shadowSpread() );
72 connect( mAngleWidget, SIGNAL( valueChanged(
int ) ),
this, SLOT( updateRenderer() ) );
73 connect( mHeightWidget, SIGNAL( fieldChanged(
QString ) ),
this, SLOT( updateRenderer() ) );
74 connect( mWallColorButton, SIGNAL( colorChanged(
QColor ) ),
this, SLOT( updateRenderer() ) );
75 connect( mRoofColorButton, SIGNAL( colorChanged(
QColor ) ),
this, SLOT( updateRenderer() ) );
76 connect( mShadowColorButton, SIGNAL( colorChanged(
QColor ) ),
this, SLOT( updateRenderer() ) );
77 connect( mShadowEnabledWidget, SIGNAL( toggled(
bool ) ),
this, SLOT( updateRenderer() ) );
78 connect( mShadowSizeWidget, SIGNAL( valueChanged(
double ) ),
this, SLOT( updateRenderer() ) );
79 connect( mWallExpositionShading, SIGNAL( toggled(
bool ) ),
this, SLOT( updateRenderer() ) );
87 void Qgs25DRendererWidget::updateRenderer()
98 void Qgs25DRendererWidget::apply()
bool wallShadingEnabled()
Get wall shading enabled.
QColor wallColor() const
Get the wall color.
static Qgs25DRenderer * convertFromRenderer(QgsFeatureRendererV2 *renderer)
Try to convert from an existing renderer.
QString tr(const char *sourceText, const char *disambiguation, int n)
bool shadowEnabled() const
Is the shadow enabled.
void setShadowSpread(double shadowSpread)
Set the shadow's spread distance in map units.
QColor shadowColor() const
Get the shadow's color.
QVariant variable(const QString &name) const
Retrieves a variable's value from the scope.
QGis::GeometryType geometryType() const
Returns point, line or polygon.
Single scope for storing variables and functions for use within a QgsExpressionContext.
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)
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.
QColor roofColor() const
Get the roof color.
double toDouble(bool *ok) const
QString name
Read property of QString layerName.
double shadowSpread() const
Get the shadow's spread distance in map units.
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.