18#ifndef QGSPOINTCLOUDLAYER_H
19#define QGSPOINTCLOUDLAYER_H
33using namespace Qt::StringLiterals;
107 Calculating = 1 << 0,
110 Q_ENUM( PointCloudStatisticsCalculationState )
116 const QString &baseName = QString(),
117 const QString &providerLib = u
"pointcloud"_s,
126 SIP_PYOBJECT __repr__();
128 QString str = u
"<QgsPointCloudLayer: '%1' (%2)>"_s.arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : u
"Invalid"_s );
129 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
144 bool supportsEditing() const override;
145 bool isEditable() const override;
146 bool isModified() const override;
150 bool writeXml( QDomNode &layerNode, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
152 bool readSymbology( const QDomNode &node, QString &errorMessage,
154 bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) final;
156 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context,
157 StyleCategories categories = AllStyleCategories ) const override;
158 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const final;
162 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
163 QString decodedSource( const QString &source, const QString &dataProvider, const
QgsReadWriteContext &context ) const override;
164 QString loadDefaultStyle(
bool &resultFlag
SIP_OUT ) final;
165 QString htmlMetadata() const override;
176 qint64 pointCount() const;
209 bool setSubsetString( const QString &subset );
217 QString subsetString() const;
225 void setSync3DRendererTo2DRenderer(
bool sync );
233 bool sync3DRendererTo2DRenderer() const;
241 bool convertRenderer3DFromRenderer2D();
292 bool commitChanges(
bool stopEditing =
true );
300 QString commitError()
const;
388 bool isReadOnly()
const override {
return true;}
390 void calculateStatistics();
392 void resetRenderer();
394 void loadIndexesForRenderContext(
QgsRenderContext &rendererContext )
const;
400 std::unique_ptr<QgsPointCloudDataProvider> mDataProvider;
402 std::unique_ptr<QgsPointCloudRenderer> mRenderer;
406 LayerOptions mLayerOptions;
408 bool mSync3DRendererTo2DRenderer =
true;
410 PointCloudStatisticsCalculationState mStatisticsCalculationState = PointCloudStatisticsCalculationState::NotStarted;
411 long mStatsCalculationTask = 0;
414 QString mCommitError;
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
Base class for point cloud 3D renderers.
Abstract base class for objects which generate elevation profiles.
Interface for classes which can generate elevation profiles.
virtual QgsAbstractProfileGenerator * createProfileGenerator(const QgsProfileRequest &request)=0
Given a profile request, returns a new profile generator ready for generating elevation profiles.
Contains information about the context in which a coordinate transform is executed.
Base class for storage of map layer elevation properties.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
QgsMapLayer(Qgis::LayerType type=Qgis::LayerType::Vector, const QString &name=QString(), const QString &source=QString())
Constructor for QgsMapLayer.
QgsMapLayer::LayerFlags flags
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
virtual Q_INVOKABLE QgsDataProvider * dataProvider()
Returns the layer's data provider, it may be nullptr.
A collection of point cloud attributes.
Attribute for point cloud data pair of name and size in bytes.
Base class for providing data for QgsPointCloudLayer.
PointCloudIndexGenerationState
Point cloud index state.
Smart pointer for QgsAbstractPointCloudIndex.
Point cloud layer specific subclass of QgsMapLayerElevationProperties.
Implementation of threaded rendering for point cloud layers.
Represents a map layer supporting display of point clouds.
PointCloudStatisticsCalculationState
Point cloud statistics calculation task.
QgsRectangle extent() const override
Returns the extent of the layer.
void raiseError(const QString &msg)
Signals an error related to this point cloud layer.
PointCloudStatisticsCalculationState statisticsCalculationState() const
Returns the status of point cloud statistics calculation.
QString profileSourceName() const override
Returns a name for displaying this profile source in the elevation profile layer tree.
QgsPointCloudLayer(const QgsPointCloudLayer &rhs)=delete
void statisticsCalculationStateChanged(QgsPointCloudLayer::PointCloudStatisticsCalculationState state)
Emitted when statistics calculation state has changed.
QString profileSourceId() const override
Returns a unique identifier for this profile source.
const QgsPointCloudStatistics statistics() const
Returns the object containing statistics.
QgsAbstractProfileSource * profileSource() override
Returns the layer's profile source if it has profile capabilities.
QgsPointCloudLayer(const QString &uri=QString(), const QString &baseName=QString(), const QString &providerLib=u"pointcloud"_s, const QgsPointCloudLayer::LayerOptions &options=QgsPointCloudLayer::LayerOptions())
Constructor - creates a point cloud layer.
void chunkAttributeValuesChanged(const QgsPointCloudNodeId &n)
Emitted when a node gets some attribute values of some points changed.
friend class TestQgsVirtualPointCloudProvider
void subsetStringChanged()
Emitted when the layer's subset string has changed.
QgsPointCloudLayer & operator=(QgsPointCloudLayer const &rhs)=delete
QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext) override
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
Represents an indexed point cloud node's position in octree.
Abstract base class for 2d point cloud renderers.
Used to store statistics of a point cloud dataset.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
A container for the context for various read/write operations on objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
#define SIP_ENUM_BASETYPE(type)
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 skipStatisticsCalculation
Set to true if the statistics calculation for this point cloud is disabled.
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.
LayerOptions(const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions with optional transformContext.
QgsCoordinateTransformContext transformContext
Coordinate transform context.