23 #define ROOF_EXPRESSION \ 26 " cos( radians( eval( @qgis_25d_angle ) ) ) * eval( @qgis_25d_height )," \ 27 " sin( radians( eval( @qgis_25d_angle ) ) ) * eval( @qgis_25d_height )" \ 30 #define WALL_EXPRESSION \ 33 " segments_to_lines( $geometry )," \ 34 " cos( radians( eval( @qgis_25d_angle ) ) ) * eval( @qgis_25d_height )," \ 35 " sin( radians( eval( @qgis_25d_angle ) ) ) * eval( @qgis_25d_height )" \ 37 " 'distance( $geometry, translate( @map_extent_center, 1000 * @map_extent_width * cos( radians( @qgis_25d_angle + 180 ) ), 1000 * @map_extent_width * sin( radians( @qgis_25d_angle + 180 ) ) ))'," \ 41 #define ORDER_BY_EXPRESSION \ 45 " @map_extent_center," \ 46 " 1000 * @map_extent_width * cos( radians( @qgis_25d_angle + 180 ) )," \ 47 " 1000 * @map_extent_width * sin( radians( @qgis_25d_angle + 180 ) )" \ 51 #define WALL_SHADING_EXPRESSION \ 55 " 40 + 19 * abs( $pi - azimuth( " \ 56 " point_n( geometry_n($geometry, @geometry_part_num) , 1 ), " \ 57 " point_n( geometry_n($geometry, @geometry_part_num) , 2 )" \ 66 mSymbol->deleteSymbolLayer( 0 );
72 wallProperties.
insert(
"symbolType",
"Fill" );
77 roofProperties.
insert(
"symbolType",
"Fill" );
82 mSymbol->appendSymbolLayer( floor );
83 mSymbol->appendSymbolLayer( walls );
84 mSymbol->appendSymbolLayer( roof );
130 if ( symbols.
size() )
140 mSymbol->startRender( context, &fields );
145 mSymbol->stopRender( context );
150 return mSymbol->usedAttributes().toList();
156 c->mSymbol.
reset( mSymbol->clone() );
164 return mSymbol.
data();
177 return static_cast<QgsFillSymbolLayerV2*
>( mSymbol->symbolLayer( 2 )->subSymbol()->symbolLayer( 0 ) );
182 return static_cast<QgsFillSymbolLayerV2*
>( mSymbol->symbolLayer( 1 )->subSymbol()->symbolLayer( 0 ) );
193 return glowEffect()->
enabled();
203 return glowEffect()->
color();
208 glowEffect()->
setColor( shadowColor );
213 return glowEffect()->
spread();
255 if ( renderer->
type() ==
"25dRenderer" )
void setLocked(bool locked)
QDomNodeList elementsByTagName(const QString &tagname) const
void stopRender(QgsRenderContext &context) override
Needs to be called when a render cycle has finished to clean up.
void setActive(bool active)
#define RENDERER_TAG_NAME
static QgsSymbolLayerV2 * create(const QgsStringMap &properties)
void setEnabled(const bool enabled)
Sets whether the effect is enabled.
bool wallShadingEnabled()
Get wall shading enabled.
A container class for data source field mapping or expression.
void startRender(QgsRenderContext &context, const QgsFields &fields) override
Needs to be called when a new render cycle is started.
virtual void setOutlineColor(const QColor &color)
Set outline color.
QDomNode appendChild(const QDomNode &newChild)
QColor wallColor() const
Get the wall color.
static QgsFeatureRendererV2 * create(QDomElement &element)
Create a new 2.5D renderer from XML.
void setSpreadUnit(const QgsSymbolV2::OutputUnit unit)
Sets the units used for the glow spread distance.
static Qgs25DRenderer * convertFromRenderer(QgsFeatureRendererV2 *renderer)
Try to convert from an existing renderer.
static QDomElement saveSymbol(const QString &symbolName, QgsSymbolV2 *symbol, QDomDocument &doc)
Container of fields for a vector layer.
#define WALL_SHADING_EXPRESSION
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual QgsDataDefined * getDataDefinedProperty(const QString &property) const
Returns the data defined property corresponding to the specified property key.
QDomElement save(QDomDocument &doc) override
store renderer info to XML element
static QgsSymbolV2 * loadSymbol(const QDomElement &element)
Attempts to load a symbol from a DOM element.
QDomElement toElement() const
void setBlurLevel(const int level)
Sets blur level (strength) for the glow.
virtual QgsFeatureRendererV2 * clone() const =0
bool shadowEnabled() const
Is the shadow enabled.
void append(const T &value)
virtual QColor fillColor() const
Get fill color.
void setAttribute(const QString &name, const QString &value)
void setOrderByEnabled(bool enabled)
Sets whether custom ordering should be applied before features are processed by this renderer...
void setShadowSpread(double shadowSpread)
Set the shadow's spread distance in map units.
QColor shadowColor() const
Get the shadow's color.
QgsPaintEffect * effect(int index) const
Returns a pointer to the effect at a specified index within the stack.
#define ORDER_BY_EXPRESSION
The output shall be in map unitx.
A paint effect which consists of a stack of other chained paint effects.
bool enabled() const
Returns whether the effect is enabled.
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
void setSpread(const double spread)
Sets the spread distance for drawing the glow effect.
void appendEffect(QgsPaintEffect *effect)
Appends an effect to the end of the stack.
virtual void setFillColor(const QColor &color)
Set fill color.
A paint effect which draws a glow outside of a picture.
The OrderByClause class represents an order by clause for a QgsFeatureRequest.
QgsFeatureRequest::OrderBy orderBy() const
Get the order in which features shall be processed by this renderer.
Contains information about the context of a rendering operation.
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Define the order in which features shall be processed by this renderer.
double spread() const
Returns the spread distance used for drawing the glow effect.
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.
QgsFeatureRendererV2 * clone() const override
iterator insert(const Key &key, const T &value)
virtual QgsSymbolV2 * symbolForFeature(QgsFeature &feature, QgsRenderContext &context) override
To be overridden.
QList< QString > usedAttributes() override
Returns a set of attributes required for this renderer.
double shadowSpread() const
Get the shadow's spread distance in map units.
QDomElement createElement(const QString &tagName)
void setShadowColor(const QColor &shadowColor)
Set the shadow's color.
void setColor(const QColor &color)
Sets the color for the glow.
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the layer.
void setWallColor(const QColor &wallColor)
Set the wall color.
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
Represents a list of OrderByClauses, with the most important first and the least important last...
QDomNode at(int index) const
virtual Q_DECL_DEPRECATED void setDataDefinedProperty(const QString &property, const QString &expressionString)
Sets a data defined expression for a property.
QColor color() const
Returns the color for the glow.