18#ifndef QGSPOINTCLOUDINDEX_H
19#define QGSPOINTCLOUDINDEX_H
26#include "qgspointcloudexpression.h"
70 return mD == other.
d() && mX == other.
x() && mY == other.
y() && mZ == other.
z();
83 QString toString()
const;
98 int mD = -1, mX = -1, mY = -1, mZ = -1;
129 QString
uri()
const {
return mUri; }
141 QString mSubsetString;
168 const QList<QgsPointCloudNodeId> &childIds,
173 , mChildIds( childIds )
183 QList<QgsPointCloudNodeId>
children()
const {
return mChildIds; }
196 QList<QgsPointCloudNodeId> mChildIds;
221 virtual void load(
const QString &uri,
const QString &authcfg = QString() ) = 0;
301 virtual bool updateNodeData(
const QHash<QgsPointCloudNodeId, QByteArray> &data );
331 virtual bool setSubsetString(
const QString &subset );
339 virtual QString subsetString()
const;
363 const QgsPointCloudExpression &expression,
const QString &uri );
371 virtual QVariantMap extraMetadata()
const;
393 static QCache<QgsPointCloudCacheKey, QgsPointCloudBlock>
sBlockCache;
416 operator bool()
const;
428 void load(
const QString &url,
const QString &authcfg = QString() );
435 bool isValid()
const;
442 QString error()
const;
466 qint64 pointCount()
const;
473 QVariantMap originalMetadata()
const;
549 bool updateNodeData(
const QHash<QgsPointCloudNodeId, QByteArray> &data );
607 bool setSubsetString(
const QString &subset );
615 QString subsetString()
const;
639 QVariantMap extraMetadata()
const;
647 bool commitChanges( QString *errorMessage
SIP_OUT =
nullptr );
650 bool isModified()
const;
653 QList<QgsPointCloudNodeId> updatedNodes()
const;
656 std::shared_ptr<QgsAbstractPointCloudIndex> mIndex;
PointCloudAccessType
The access type of the data, local is for local files and remote for remote files (over HTTP).
Represents an indexed point clouds data in octree.
virtual ~QgsAbstractPointCloudIndex()
virtual QVariantMap originalMetadata() const =0
Returns the original metadata map.
virtual qint64 pointCount() const =0
Returns the number of points in the point cloud.
QgsPointCloudAttributeCollection mAttributes
QHash< QgsPointCloudNodeId, int > mHierarchy
Data hierarchy.
QgsBox3D rootNodeBounds() const
Returns bounding box of root node in CRS coords.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate reference system of the point cloud index.
QgsRectangle extent() const
Returns extent of the data.
virtual bool writeStatistics(QgsPointCloudStatistics &stats)
Writes the statistics object stats into the backing file, if possible.
QgsBox3D mRootBounds
Bounds of the root node's cube (in int32 coordinates).
static QMutex sBlockCacheMutex
QgsVector3D mOffset
Offset of our int32 coordinates compared to CRS coords.
QgsPointCloudExpression mFilterExpression
The filter expression to be evaluated when fetching node data.
virtual QgsPointCloudBlockRequest * asyncNodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns a handle responsible for loading a node data block.
virtual Qgis::PointCloudAccessType accessType() const =0
Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP s...
virtual bool updateNodeData(const QHash< QgsPointCloudNodeId, QByteArray > &data)
Tries to update the data for the specified nodes.
static QCache< QgsPointCloudCacheKey, QgsPointCloudBlock > sBlockCache
int mSpan
All native attributes stored in the file.
double mZMax
Vertical extent of data.
QgsRectangle mExtent
2D extent of data
QString error() const
Returns the error that occurred during the loading of the index.
QgsPointCloudNodeId root() const
Returns root node of the index.
virtual QgsPointCloudStatistics metadataStatistics() const
Returns the object containing the statistics metadata extracted from the dataset.
virtual void load(const QString &uri, const QString &authcfg=QString())=0
Loads the index from the uri, using an optional authcfg for network requests.
QgsVector3D mScale
Scale of our int32 coordinates compared to CRS coords.
virtual std::unique_ptr< QgsPointCloudBlock > nodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns node data block.
QgsAbstractPointCloudIndex()
Constructs index.
double zMax() const
Returns z max.
virtual bool isValid() const =0
Returns whether index is loaded and valid.
double zMin() const
Returns z min.
A 3-dimensional box composed of x, y, z coordinates.
Represents a coordinate reference system (CRS).
A collection of point cloud attributes.
Base class for handling loading QgsPointCloudBlock asynchronously.
Base class for storing raw data from point cloud nodes.
Container class for QgsPointCloudBlock cache keys.
QString subsetString() const
Returns the key's subset string. This is used in the point cloud index as a filter expression.
QgsPointCloudRequest request() const
Returns the key's QgsPointCloudRequest.
QgsPointCloudNodeId node() const
Returns the key's QgsPointCloudNodeId.
bool operator==(const QgsPointCloudCacheKey &other) const
QString uri() const
Returns the key's uri.
QgsPointCloudCacheKey(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request, const QString &subset, const QString &uri)
Ctor.
friend class TestQgsPointCloudEditing
QgsPointCloudIndex(QgsAbstractPointCloudIndex *index=nullptr)
Construct wrapper, takes ownership of index.
QgsAbstractPointCloudIndex * get()
Returns pointer to the implementation class.
Represents an indexed point cloud node's position in octree.
bool isValid() const
Returns whether node is valid.
bool operator==(QgsPointCloudNodeId other) const
QgsPointCloudNodeId()
Constructs invalid node.
Keeps metadata for an indexed point cloud node.
QList< QgsPointCloudNodeId > children() const
Returns IDs of child nodes.
qint64 pointCount() const
Returns number of points contained in node data.
QgsPointCloudNodeId id() const
Returns node's ID (unique in index).
static QgsBox3D bounds(QgsBox3D rootBounds, QgsPointCloudNodeId id)
Returns bounding box of specific node.
float error() const
Returns node's error in map units (used to determine in whether the node has enough detail for the cu...
QgsPointCloudNode(const QgsPointCloudNodeId &id, qint64 pointCount, const QList< QgsPointCloudNodeId > &childIds, float error, const QgsBox3D &bounds)
Constructs new node object.
QgsBox3D bounds() const
Returns node's bounding cube in CRS coords.
Point cloud data request.
Used to store statistics of a point cloud dataset.
A rectangle specified with double values.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
#define SIP_NODEFAULTCTORS
Q_DECLARE_TYPEINFO(QgsPointCloudNodeId, Q_PRIMITIVE_TYPE)
CORE_EXPORT uint qHash(QgsPointCloudNodeId id)
Hash function for indexed nodes.