51 return qobject_cast<QgsTiledSceneLayer *>( mLayerRef.
layer );
69 return new QgsTiledSceneLayerChunkedEntity( map, index,
72 qgis::down_cast< const QgsTiledSceneLayerElevationProperties * >( tsl->
elevationProperties() )->zScale(),
73 qgis::down_cast< const QgsTiledSceneLayerElevationProperties * >( tsl->
elevationProperties() )->zOffset() );
80 QDomDocument doc = elem.ownerDocument();
82 elem.setAttribute( QStringLiteral(
"layer" ), mLayerRef.
layerId );
84 elem.setAttribute( QStringLiteral(
"show-bounding-boxes" ),
showBoundingBoxes() ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
91 mLayerRef =
QgsMapLayerRef( elem.attribute( QStringLiteral(
"layer" ) ) );
93 mShowBoundingBoxes = elem.attribute( QStringLiteral(
"show-bounding-boxes" ), QStringLiteral(
"0" ) ).toInt();
94 mMaximumScreenError = elem.attribute( QStringLiteral(
"max-screen-error" ), QStringLiteral(
"16.0" ) ).toDouble();
104 return mMaximumScreenError;
109 mMaximumScreenError = error;
114 return mShowBoundingBoxes;
Base class for all renderers that may to participate in 3D view.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
The class is used as a container of context for various read/write operations on other objects.
virtual QgsTiledSceneIndex index() const =0
Returns the provider's tile index.
An index for tiled scene data providers.
QgsTiledSceneLayer * layer() const
Returns tiled scene layer associated with the renderer.
void setLayer(QgsTiledSceneLayer *layer)
Sets tiled scene layer associated with the renderer.
virtual void resolveReferences(const QgsProject &project) override
Resolves references to other objects - second phase of loading - after readXml()
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads renderer's properties from given XML element.
bool showBoundingBoxes() const
Returns whether bounding boxes will be visible when rendering the tiled scene.
double maximumScreenError() const
Returns the maximum screen error allowed when rendering the tiled scene.
QgsTiledSceneLayer3DRenderer()
virtual QgsAbstract3DRenderer * clone() const override
Returns a cloned instance.
void setShowBoundingBoxes(bool showBoundingBoxes)
Sets whether bounding boxes will be visible when rendering the tiled scene.
void setMaximumScreenError(double error)
Sets the maximum screen error allowed when rendering the tiled scene.
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
virtual Qt3DCore::QEntity * createEntity(const Qgs3DMapSettings &map) const override
Returns a 3D entity that will be used to show renderer's data in 3D scene.
Represents a map layer supporting display of tiled scene objects.
QgsMapLayerElevationProperties * elevationProperties() override
Returns the layer's elevation properties.
QgsTiledSceneDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
_LayerRef< QgsMapLayer > QgsMapLayerRef
QPointer< TYPE > layer
Weak pointer to map layer.
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
QString layerId
Original layer ID.