38 const QString &baseName,
39 const QString &providerLib,
44 if ( !uri.isEmpty() && !providerLib.isEmpty() )
47 QgsDataProvider::ReadFlags providerFlags = QgsDataProvider::ReadFlags();
52 setDataSource( uri, baseName, providerLib, providerOptions, providerFlags );
55 mDataProvider.get()->generateIndex();
84 return mDataProvider->extent();
94 return mDataProvider.get();
99 return mDataProvider.get();
105 QDomNode pkeyNode = layerNode.namedItem( QStringLiteral(
"provider" ) );
111 QgsDataProvider::ReadFlags
flags = QgsDataProvider::ReadFlags();
115 const QDomNode extentNode = layerNode.namedItem( QStringLiteral(
"extent" ) );
116 if ( !extentNode.isNull() )
150 QDomElement mapLayerNode = layerNode.toElement();
155 QDomElement provider = doc.createElement( QStringLiteral(
"provider" ) );
156 QDomText providerText = doc.createTextNode(
providerType() );
157 provider.appendChild( providerText );
158 layerNode.appendChild( provider );
169 QDomElement elem = node.toElement();
173 readStyle( node, errorMessage, context, categories );
187 QDomElement rendererElement = node.firstChildElement( QStringLiteral(
"renderer" ) );
188 if ( !rendererElement.isNull() )
210 QDomNode blendModeNode = node.namedItem( QStringLiteral(
"blendMode" ) );
211 if ( !blendModeNode.isNull() )
213 QDomElement e = blendModeNode.toElement();
221 QDomNode layerOpacityNode = node.namedItem( QStringLiteral(
"layerOpacity" ) );
222 if ( !layerOpacityNode.isNull() )
224 QDomElement e = layerOpacityNode.toElement();
228 const bool hasScaleBasedVisibiliy { node.attributes().namedItem( QStringLiteral(
"hasScaleBasedVisibilityFlag" ) ).nodeValue() ==
'1' };
231 const double maxScale { node.attributes().namedItem( QStringLiteral(
"maxScale" ) ).nodeValue().toDouble( &ok ) };
236 const double minScale { node.attributes().namedItem( QStringLiteral(
"minScale" ) ).nodeValue().toDouble( &ok ) };
248 Q_UNUSED( errorMessage )
250 QDomElement elem = node.toElement();
253 ( void )
writeStyle( node, doc, errorMessage, context, categories );
260 QDomElement mapLayerNode = node.toElement();
266 QDomElement rendererElement = mRenderer->save( doc, context );
267 node.appendChild( rendererElement );
280 QDomElement blendModeElem = doc.createElement( QStringLiteral(
"blendMode" ) );
282 blendModeElem.appendChild( blendModeText );
283 node.appendChild( blendModeElem );
289 QDomElement layerOpacityElem = doc.createElement( QStringLiteral(
"layerOpacity" ) );
290 QDomText layerOpacityText = doc.createTextNode( QString::number(
opacity() ) );
291 layerOpacityElem.appendChild( layerOpacityText );
292 node.appendChild( layerOpacityElem );
294 mapLayerNode.setAttribute( QStringLiteral(
"hasScaleBasedVisibilityFlag" ),
hasScaleBasedVisibility() ? 1 : 0 );
295 mapLayerNode.setAttribute( QStringLiteral(
"maxScale" ),
maximumScale() );
296 mapLayerNode.setAttribute( QStringLiteral(
"minScale" ),
minimumScale() );
309 void QgsPointCloudLayer::setDataSourcePrivate(
const QString &dataSource,
const QString &baseName,
const QString &provider,
323 if ( !mDataProvider )
325 QgsDebugMsg( QStringLiteral(
"Unable to get point cloud data provider" ) );
330 mDataProvider->setParent(
this );
331 QgsDebugMsgLevel( QStringLiteral(
"Instantiated the point cloud data provider plugin" ), 2 );
333 setValid( mDataProvider->isValid() );
336 QgsDebugMsg( QStringLiteral(
"Invalid point cloud provider plugin %1" ).arg( QString(
mDataSource.toUtf8() ) ) );
344 setCrs( mDataProvider->crs() );
350 bool loadDefaultStyleFlag =
false;
353 loadDefaultStyleFlag =
true;
356 if ( !mRenderer || loadDefaultStyleFlag )
358 std::unique_ptr< QgsScopedRuntimeProfile > profile;
360 profile = std::make_unique< QgsScopedRuntimeProfile >( tr(
"Load layer style" ), QStringLiteral(
"projectload" ) );
362 bool defaultLoadedFlag =
false;
367 std::unique_ptr< QgsPointCloudRenderer > defaultRenderer( mDataProvider->createRenderer() );
368 if ( defaultRenderer )
370 defaultLoadedFlag =
true;
375 if ( !defaultLoadedFlag && loadDefaultStyleFlag )
380 if ( !defaultLoadedFlag )
391 if ( parts.contains( QStringLiteral(
"path" ) ) )
393 parts.insert( QStringLiteral(
"path" ), context.
pathResolver().
writePath( parts.value( QStringLiteral(
"path" ) ).toString() ) );
405 if ( parts.contains( QStringLiteral(
"path" ) ) )
407 parts.insert( QStringLiteral(
"path" ), context.
pathResolver().
readPath( parts.value( QStringLiteral(
"path" ) ).toString() ) );
420 mDataProvider.get()->loadIndex();
421 if ( mRenderer->type() == QLatin1String(
"extent" ) )
436 std::unique_ptr< QgsPointCloudRenderer > defaultRenderer( mDataProvider->createRenderer() );
437 if ( defaultRenderer )
451 QString myMetadata = QStringLiteral(
"<html>\n<body>\n" );
454 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Information from provider" ) + QStringLiteral(
"</h1>\n<hr>\n" );
455 myMetadata += QLatin1String(
"<table class=\"list-view\">\n" );
458 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Name" ) + QStringLiteral(
"</td><td>" ) +
name() + QStringLiteral(
"</td></tr>\n" );
463 if ( uriComponents.contains( QStringLiteral(
"path" ) ) )
465 path = uriComponents[QStringLiteral(
"path" )].toString();
466 if ( QFile::exists( path ) )
467 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Path" ) + QStringLiteral(
"</td><td>%1" ).arg( QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( path ).toString(), QDir::toNativeSeparators( path ) ) ) + QStringLiteral(
"</td></tr>\n" );
469 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"URL" ) + QStringLiteral(
"</td><td>%1" ).arg( QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl( path ).toString(), path ) ) + QStringLiteral(
"</td></tr>\n" );
474 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Source" ) + QStringLiteral(
"</td><td>%1" ).arg(
publicSource() ) + QStringLiteral(
"</td></tr>\n" );
477 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Extent" ) + QStringLiteral(
"</td><td>" ) +
extent().
toString() + QStringLiteral(
"</td></tr>\n" );
480 QLocale locale = QLocale();
481 locale.setNumberOptions( locale.numberOptions() &= ~QLocale::NumberOption::OmitGroupSeparator );
482 const qint64
pointCount = mDataProvider ? mDataProvider->pointCount() : -1;
483 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
484 + tr(
"Point count" ) + QStringLiteral(
"</td><td>" )
485 + (
pointCount < 0 ? tr(
"unknown" ) : locale.toString(
static_cast<qlonglong
>(
pointCount ) ) )
486 + QStringLiteral(
"</td></tr>\n" );
487 myMetadata += QLatin1String(
"</table>\n<br><br>" );
493 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Metadata" ) + QStringLiteral(
"</h1>\n<hr>\n" ) + QStringLiteral(
"<table class=\"list-view\">\n" );
494 const QVariantMap originalMetadata = mDataProvider ? mDataProvider->originalMetadata() : QVariantMap();
496 if ( originalMetadata.value( QStringLiteral(
"creation_year" ) ).toInt() > 0 && originalMetadata.contains( QStringLiteral(
"creation_doy" ) ) )
498 QDate creationDate( originalMetadata.value( QStringLiteral(
"creation_year" ) ).toInt(), 1, 1 );
499 creationDate = creationDate.addDays( originalMetadata.value( QStringLiteral(
"creation_doy" ) ).toInt() );
501 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
502 + tr(
"Creation date" ) + QStringLiteral(
"</td><td>" )
503 + creationDate.toString( Qt::ISODate )
504 + QStringLiteral(
"</td></tr>\n" );
506 if ( originalMetadata.contains( QStringLiteral(
"major_version" ) ) && originalMetadata.contains( QStringLiteral(
"minor_version" ) ) )
508 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
509 + tr(
"Version" ) + QStringLiteral(
"</td><td>" )
510 + QStringLiteral(
"%1.%2" ).arg( originalMetadata.value( QStringLiteral(
"major_version" ) ).toString(),
511 originalMetadata.value( QStringLiteral(
"minor_version" ) ).toString() )
512 + QStringLiteral(
"</td></tr>\n" );
515 if ( !originalMetadata.value( QStringLiteral(
"dataformat_id" ) ).toString().isEmpty() )
517 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
518 + tr(
"Data format" ) + QStringLiteral(
"</td><td>" )
520 originalMetadata.value( QStringLiteral(
"dataformat_id" ) ).toString() ).trimmed()
521 + QStringLiteral(
"</td></tr>\n" );
524 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
525 + tr(
"Scale X" ) + QStringLiteral(
"</td><td>" )
526 + QString::number( originalMetadata.value( QStringLiteral(
"scale_x" ) ).toDouble() )
527 + QStringLiteral(
"</td></tr>\n" );
528 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
529 + tr(
"Scale Y" ) + QStringLiteral(
"</td><td>" )
530 + QString::number( originalMetadata.value( QStringLiteral(
"scale_y" ) ).toDouble() )
531 + QStringLiteral(
"</td></tr>\n" );
532 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
533 + tr(
"Scale Z" ) + QStringLiteral(
"</td><td>" )
534 + QString::number( originalMetadata.value( QStringLiteral(
"scale_z" ) ).toDouble() )
535 + QStringLiteral(
"</td></tr>\n" );
537 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
538 + tr(
"Offset X" ) + QStringLiteral(
"</td><td>" )
539 + QString::number( originalMetadata.value( QStringLiteral(
"offset_x" ) ).toDouble() )
540 + QStringLiteral(
"</td></tr>\n" );
541 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
542 + tr(
"Offset Y" ) + QStringLiteral(
"</td><td>" )
543 + QString::number( originalMetadata.value( QStringLiteral(
"offset_y" ) ).toDouble() )
544 + QStringLiteral(
"</td></tr>\n" );
545 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
546 + tr(
"Offset Z" ) + QStringLiteral(
"</td><td>" )
547 + QString::number( originalMetadata.value( QStringLiteral(
"offset_z" ) ).toDouble() )
548 + QStringLiteral(
"</td></tr>\n" );
550 if ( !originalMetadata.value( QStringLiteral(
"project_id" ) ).toString().isEmpty() )
552 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
553 + tr(
"Project ID" ) + QStringLiteral(
"</td><td>" )
554 + originalMetadata.value( QStringLiteral(
"project_id" ) ).toString()
555 + QStringLiteral(
"</td></tr>\n" );
558 if ( !originalMetadata.value( QStringLiteral(
"system_id" ) ).toString().isEmpty() )
560 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
561 + tr(
"System ID" ) + QStringLiteral(
"</td><td>" )
562 + originalMetadata.value( QStringLiteral(
"system_id" ) ).toString()
563 + QStringLiteral(
"</td></tr>\n" );
566 if ( !originalMetadata.value( QStringLiteral(
"software_id" ) ).toString().isEmpty() )
568 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
569 + tr(
"Software ID" ) + QStringLiteral(
"</td><td>" )
570 + originalMetadata.value( QStringLiteral(
"software_id" ) ).toString()
571 + QStringLiteral(
"</td></tr>\n" );
575 myMetadata += QLatin1String(
"</table>\n<br><br>" );
578 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Identification" ) + QStringLiteral(
"</h1>\n<hr>\n" );
580 myMetadata += QLatin1String(
"<br><br>\n" );
583 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Extent" ) + QStringLiteral(
"</h1>\n<hr>\n" );
585 myMetadata += QLatin1String(
"<br><br>\n" );
588 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Access" ) + QStringLiteral(
"</h1>\n<hr>\n" );
590 myMetadata += QLatin1String(
"<br><br>\n" );
593 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Attributes" ) + QStringLiteral(
"</h1>\n<hr>\n<table class=\"list-view\">\n" );
598 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Count" ) + QStringLiteral(
"</td><td>" ) + QString::number( attrs.
count() ) + QStringLiteral(
"</td></tr>\n" );
600 myMetadata += QLatin1String(
"</table>\n<br><table width=\"100%\" class=\"tabular-view\">\n" );
601 myMetadata += QLatin1String(
"<tr><th>" ) + tr(
"Attribute" ) + QLatin1String(
"</th><th>" ) + tr(
"Type" ) + QLatin1String(
"</th></tr>\n" );
603 for (
int i = 0; i < attrs.
count(); ++i )
608 rowClass = QStringLiteral(
"class=\"odd-row\"" );
609 myMetadata += QLatin1String(
"<tr " ) + rowClass + QLatin1String(
"><td>" ) + attribute.
name() + QLatin1String(
"</td><td>" ) + attribute.
displayType() + QLatin1String(
"</td></tr>\n" );
613 myMetadata += QLatin1String(
"</table>\n<br><br>" );
617 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Contacts" ) + QStringLiteral(
"</h1>\n<hr>\n" );
619 myMetadata += QLatin1String(
"<br><br>\n" );
622 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Links" ) + QStringLiteral(
"</h1>\n<hr>\n" );
624 myMetadata += QLatin1String(
"<br><br>\n" );
627 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"History" ) + QStringLiteral(
"</h1>\n<hr>\n" );
629 myMetadata += QLatin1String(
"<br><br>\n" );
631 myMetadata += QLatin1String(
"\n</body>\n</html>\n" );
637 return mElevationProperties;
647 return mDataProvider ? mDataProvider->pointCount() : 0;
652 return mRenderer.get();
657 return mRenderer.get();
static QgsPointCloudRendererRegistry * pointCloudRendererRegistry()
Returns the application's point cloud renderer registry, used for managing point cloud layer 2D rende...
static QgsRuntimeProfiler * profiler()
Returns the application runtime profiler.
Contains information about the context in which a coordinate transform is executed.
@ FlagLoadDefaultStyle
Reset the layer's style to the default for the datasource.
@ FlagTrustDataSource
Trust datasource config (primary key unicity, geometry type and srid, etc). Improves provider load ti...
@ SkipGetExtent
Skip the extent from provider.
void dataChanged()
Emitted whenever a change is made to the data provider which may have caused changes in the provider'...
Base class for storage of map layer elevation properties.
static QString typeToString(QgsMapLayerType type)
Converts a map layer type to a string value.
static QgsMapLayerLegend * defaultPointCloudLegend(QgsPointCloudLayer *layer)
Create new legend implementation for a point cloud layer.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Base class for all map layer types.
void readStyleManager(const QDomNode &layerNode)
Read style manager's configuration (if any). To be called by subclasses.
virtual bool isSpatial() const
Returns true if the layer is considered a spatial layer, ie it has some form of geometry associated w...
void writeStyleManager(QDomNode &layerNode, QDomDocument &doc) const
Write style manager's configuration (if exists). To be called by subclasses.
QString source() const
Returns the source for the layer.
QString providerType() const
Returns the provider type (provider key) for this layer.
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
void setMinimumScale(double scale)
Sets the minimum map scale (i.e.
QString publicSource() const
Gets a version of the internal layer definition that has sensitive bits removed (for example,...
QgsMapLayer::LayerFlags flags() const
Returns the flags for this layer.
void writeCustomProperties(QDomNode &layerNode, QDomDocument &doc) const
Write custom properties to project file.
virtual QString loadDefaultStyle(bool &resultFlag)
Retrieve the default style for this layer if one exists (either as a .qml file on disk or as a record...
QString mLayerName
Name of the layer - used for display.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
QString crsHtmlMetadata() const
Returns a HTML fragment containing the layer's CRS metadata, for use in the htmlMetadata() method.
void setMaximumScale(double scale)
Sets the maximum map scale (i.e.
QgsLayerMetadata metadata
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
virtual void setOpacity(double opacity)
Sets the opacity for the layer, where opacity is a value between 0 (totally transparent) and 1....
void readCustomProperties(const QDomNode &layerNode, const QString &keyStartsWith=QString())
Read custom properties from project file.
QString mProviderKey
Data provider key (name of the data provider)
QgsCoordinateTransformContext transformContext() const
Returns the layer data provider coordinate transform context or a default transform context if the la...
void rendererChanged()
Signal emitted when renderer is changed.
void setScaleBasedVisibility(bool enabled)
Sets whether scale based visibility is enabled for the layer.
bool hasScaleBasedVisibility() const
Returns whether scale based visibility is enabled for the layer.
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
void emitStyleChanged()
Triggers an emission of the styleChanged() signal.
void dataChanged()
Data of layer changed.
void setName(const QString &name)
Set the display name of the layer.
virtual void setExtent(const QgsRectangle &rect)
Sets the extent.
QString mDataSource
Data source description string, varies by layer type.
@ FlagReadExtentFromXml
Read extent from xml and skip get extent from provider.
@ FlagTrustLayerMetadata
Trust layer metadata. Improves layer load time by skipping expensive checks like primary key unicity,...
@ FlagDontResolveLayers
Don't resolve layer paths or create data providers for layers.
void setValid(bool valid)
Sets whether layer is valid or not.
void readCommonStyle(const QDomElement &layerElement, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories)
Read style data common to all layer types.
QgsMapLayer::ReadFlags mReadFlags
Read flags. It's up to the subclass to respect these when restoring state from XML.
void setDataSource(const QString &dataSource, const QString &baseName, const QString &provider, bool loadDefaultStyleFlag=false)
Updates the data source of the layer.
double minimumScale() const
Returns the minimum map scale (i.e.
void setLegend(QgsMapLayerLegend *legend)
Assign a legend controller to the map layer.
@ Rendering
Rendering: scale visibility, simplify method, opacity.
@ CustomProperties
Custom properties (by plugins for instance)
void writeCommonStyle(QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const
Write style data common to all layer types.
double maximumScale() const
Returns the maximum map scale (i.e.
void invalidateWgs84Extent()
Invalidates the WGS84 extent.
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
static QgsPainting::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
static QPainter::CompositionMode getCompositionMode(QgsPainting::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
BlendMode
Blending modes enum defining the available composition modes that can be used when rendering a layer.
QString writePath(const QString &filename) const
Prepare a filename to save it to the project file.
QString readPath(const QString &filename) const
Turn filename read from the project file to an absolute path.
Collection of point cloud attributes.
int count() const
Returns the number of attributes present in the collection.
const QgsPointCloudAttribute & at(int index) const
Returns the attribute at the specified index.
Attribute for point cloud data pair of name and size in bytes.
QString displayType() const
Returns the type to use when displaying this field.
QString name() const
Returns name of the attribute.
Base class for providing data for QgsPointCloudLayer.
@ CreateRenderer
Provider can create 2D renderers using backend-specific formatting information. See QgsPointCloudData...
static QMap< int, QString > translatedDataFormatIds()
Returns the map of LAS data format ID to translated string value.
PointCloudIndexGenerationState
Point cloud index state.
@ Indexed
The index is ready to be used.
void indexGenerationStateChanged(PointCloudIndexGenerationState state)
Emitted when point cloud generation state is changed.
Point cloud layer specific subclass of QgsMapLayerElevationProperties.
Implementation of threaded rendering for point cloud layers.
Represents a map layer supporting display of point clouds.
QString decodedSource(const QString &source, const QString &dataProvider, const QgsReadWriteContext &context) const override
Called by readLayerXML(), used by derived classes to decode provider's specific data source from proj...
QString htmlMetadata() const override
Obtain a formatted HTML string containing assorted metadata for this layer.
QgsMapLayerElevationProperties * elevationProperties() override
Returns the layer's elevation properties.
bool writeXml(QDomNode &layerNode, QDomDocument &doc, const QgsReadWriteContext &context) const override
Called by writeLayerXML(), used by children to write state specific to them to project files.
QgsRectangle extent() const override
Returns the extent of the layer.
QString encodedSource(const QString &source, const QgsReadWriteContext &context) const override
Called by writeLayerXML(), used by derived classes to encode provider's specific data source to proje...
QgsPointCloudRenderer * renderer()
Returns the 2D renderer for the point cloud.
qint64 pointCount() const
Returns the total number of points available in the layer.
bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const override
Write the style for the layer into the docment provided.
QgsPointCloudDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
bool readSymbology(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) override
Read the symbology for the current layer from the DOM node supplied.
~QgsPointCloudLayer() override
bool readXml(const QDomNode &layerNode, QgsReadWriteContext &context) override
Called by readLayerXML(), used by children to read state specific to them from project files.
QgsPointCloudLayer(const QString &uri=QString(), const QString &baseName=QString(), const QString &providerLib=QStringLiteral("pointcloud"), const QgsPointCloudLayer::LayerOptions &options=QgsPointCloudLayer::LayerOptions())
Constructor - creates a point cloud layer.
QgsPointCloudLayer * clone() const override
Returns a new instance equivalent to this one except for the id which is still unique.
bool readStyle(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) FINAL
Read the style for the current layer from the DOM node supplied.
bool writeStyle(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const FINAL
Write just the symbology information for the layer into the document.
void setRenderer(QgsPointCloudRenderer *renderer)
Sets the 2D renderer for the point cloud.
QString loadDefaultStyle(bool &resultFlag) FINAL
Retrieve the default style for this layer if one exists (either as a .qml file on disk or as a record...
QgsPointCloudAttributeCollection attributes() const
Returns the attributes available from the layer.
void setTransformContext(const QgsCoordinateTransformContext &transformContext) override
Sets the coordinate transform context to transformContext.
QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext) override
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
Abstract base class for 2d point cloud renderers.
static QgsPointCloudRenderer * load(QDomElement &element, const QgsReadWriteContext &context)
Creates a renderer from an XML element.
QVariantMap decodeUri(const QString &providerKey, const QString &uri)
Breaks a provider data source URI into its component paths (e.g.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
QString encodeUri(const QString &providerKey, const QVariantMap &parts)
Reassembles a provider data source URI from its component paths (e.g.
The class is used as a container of context for various read/write operations on other objects.
QgsCoordinateTransformContext transformContext() const
Returns data provider coordinate transform context.
const QgsPathResolver & pathResolver() const
Returns path resolver for conversion between relative and absolute paths.
A rectangle specified with double values.
QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the sp...
Contains information about the context of a rendering operation.
static QgsRectangle readRectangle(const QDomElement &element)
QgsMapLayerType
Types of layers that can be added to a map.
@ PointCloudLayer
Added in 3.18.
#define QgsDebugMsgLevel(str, level)
Setting options for creating vector data providers.
Setting options for loading point cloud layers.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
bool skipIndexGeneration
Set to true if point cloud index generation should be skipped.
QgsCoordinateTransformContext transformContext
Coordinate transform context.