51 return qobject_cast<QgsTiledSceneLayer *>( mLayerRef.
layer );
69 return new QgsTiledSceneLayerChunkedEntity( map, index,
73 qgis::down_cast< const QgsTiledSceneLayerElevationProperties * >( tsl->
elevationProperties() )->zScale(),
74 qgis::down_cast< const QgsTiledSceneLayerElevationProperties * >( tsl->
elevationProperties() )->zOffset() );
81 QDomDocument doc = elem.ownerDocument();
83 elem.setAttribute( QStringLiteral(
"layer" ), mLayerRef.
layerId );
85 elem.setAttribute( QStringLiteral(
"show-bounding-boxes" ),
showBoundingBoxes() ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
92 mLayerRef =
QgsMapLayerRef( elem.attribute( QStringLiteral(
"layer" ) ) );
94 mShowBoundingBoxes = elem.attribute( QStringLiteral(
"show-bounding-boxes" ), QStringLiteral(
"0" ) ).toInt();
95 mMaximumScreenError = elem.attribute( QStringLiteral(
"max-screen-error" ), QStringLiteral(
"16.0" ) ).toDouble();
105 return mMaximumScreenError;
110 mMaximumScreenError = error;
115 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 const QgsCoordinateReferenceSystem sceneCrs() const =0
Returns the original coordinate reference system for the tiled scene data.
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 Qt3DCore::QEntity * createEntity(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) 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.
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.