18#ifndef QGSPOINTCLOUDLAYER_H
19#define QGSPOINTCLOUDLAYER_H
105 Calculating = 1 << 0,
108 Q_ENUM( PointCloudStatisticsCalculationState )
114 const QString &baseName = QString(),
115 const QString &providerLib = QStringLiteral(
"pointcloud" ),
124 SIP_PYOBJECT __repr__();
126 QString str = QStringLiteral(
"<QgsPointCloudLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
127 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
142 bool supportsEditing() const override;
143 bool isEditable() const override;
144 bool isModified() const override;
148 bool writeXml( QDomNode &layerNode, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
150 bool readSymbology( const QDomNode &node, QString &errorMessage,
152 bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) final;
154 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context,
155 StyleCategories categories = AllStyleCategories ) const override;
156 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const final;
160 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
161 QString decodedSource( const QString &source, const QString &dataProvider, const
QgsReadWriteContext &context ) const override;
162 QString loadDefaultStyle(
bool &resultFlag
SIP_OUT ) final;
163 QString htmlMetadata() const override;
174 qint64 pointCount() const;
207 bool setSubsetString( const QString &subset );
215 QString subsetString() const;
223 void setSync3DRendererTo2DRenderer(
bool sync );
231 bool sync3DRendererTo2DRenderer() const;
239 bool convertRenderer3DFromRenderer2D();
290 bool commitChanges(
bool stopEditing =
true );
298 QString commitError()
const;
386 bool isReadOnly()
const override {
return true;}
388 void calculateStatistics();
390 void resetRenderer();
392 void loadIndexesForRenderContext(
QgsRenderContext &rendererContext )
const;
398 std::unique_ptr<QgsPointCloudDataProvider> mDataProvider;
400 std::unique_ptr<QgsPointCloudRenderer> mRenderer;
404 LayerOptions mLayerOptions;
406 bool mSync3DRendererTo2DRenderer =
true;
408 PointCloudStatisticsCalculationState mStatisticsCalculationState = PointCloudStatisticsCalculationState::NotStarted;
409 long mStatsCalculationTask = 0;
412 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.
void chunkAttributeValuesChanged(const QgsPointCloudNodeId &n)
Emitted when a node gets some attribute values of some points changed.
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.
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.