59 mSymbol.reset( symbol );
71 if ( !mSymbol || !vl )
77 return new QgsVectorLayerChunkedEntity( vl, zMin, zMax,
tilingSettings(), mSymbol.get(), map );
82 QDomDocument doc = elem.ownerDocument();
86 QDomElement elemSymbol = doc.createElement( QStringLiteral(
"symbol" ) );
89 elemSymbol.setAttribute( QStringLiteral(
"type" ), mSymbol->type() );
90 mSymbol->writeXml( elemSymbol, context );
92 elem.appendChild( elemSymbol );
99 QDomElement elemSymbol = elem.firstChildElement( QStringLiteral(
"symbol" ) );
100 QString symbolType = elemSymbol.attribute( QStringLiteral(
"type" ) );
102 if ( symbolType == QLatin1String(
"polygon" ) )
104 else if ( symbolType == QLatin1String(
"point" ) )
106 else if ( symbolType == QLatin1String(
"line" ) )
110 symbol->
readXml( elemSymbol, context );
111 mSymbol.reset( symbol );
The class is used as a container of context for various read/write operations on other objects...
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads renderer's properties from given XML element.
static void estimateVectorLayerZRange(QgsVectorLayer *layer, double &zMin, double &zMax)
Try to estimate range of Z values used in the given vector layer and store that in zMin and zMax...
Base class for all renderers that may to participate in 3D view.
QgsVectorLayer3DTilingSettings tilingSettings() const
Returns tiling settings of the renderer.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
QgsVectorLayer * layer() const
Returns vector layer associated with the renderer.
3 3D symbol that draws polygon geometries as planar polygons, optionally extruded (with added walls)...
void setSymbol(QgsAbstract3DSymbol *symbol)
Sets 3D symbol associated with the renderer. Takes ownership of the symbol.
3 Definition of the world
3 Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
QgsVectorLayer3DRenderer * clone() const override
Returns a cloned instance.
void copyBaseProperties(QgsAbstractVectorLayer3DRenderer *r) const
Copies common properties of this object to another object.
3 3D symbol that draws point geometries as 3D objects using one of the predefined shapes...
3 3D symbol that draws linestring geometries as planar polygons (created from lines using a buffer wi...
const QgsAbstract3DSymbol * symbol() const
Returns 3D symbol associated with the renderer.
3D renderer that renders all features of a vector layer with the same 3D symbol.
void writeXmlBaseProperties(QDomElement &elem, const QgsReadWriteContext &context) const
Writes common properties of this object to DOM element.
Qt3DCore::QEntity * createEntity(const Qgs3DMapSettings &map) const override
Returns a 3D entity that will be used to show renderer's data in 3D scene.
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads symbol configuration from the given DOM element.
Represents a vector layer which manages a vector based data sets.
QgsVectorLayer3DRenderer(QgsAbstract3DSymbol *s=nullptr)
Takes ownership of the symbol object.
void readXmlBaseProperties(const QDomElement &elem, const QgsReadWriteContext &context)
Reads common properties of this object from DOM element.