18#ifndef QGSPOINTCLOUDINDEX_H
19#define QGSPOINTCLOUDINDEX_H
26#include "qgspointcloudexpression.h"
80 QVector<QgsPointCloudNodeId> childrenNodes()
const;
86 QString toString()
const;
103 long __hash__()
const;
105 sipRes =
qHash( *sipCpp );
110 int mD = -1, mX = -1, mY = -1, mZ = -1;
119 return qHashMulti( seed,
id.d(),
id.x(),
id.y(),
id.z() );
146 QString
uri()
const {
return mUri; }
158 QString mSubsetString;
188 , mChildIds( childIds )
197 QList<QgsPointCloudNodeId>
children()
const {
return mChildIds; }
210 QList<QgsPointCloudNodeId> mChildIds;
235 virtual void load(
const QString &
uri,
const QString &authcfg = QString() ) = 0;
315 virtual bool updateNodeData(
const QHash<QgsPointCloudNodeId, QByteArray> &data );
345 virtual bool setSubsetString(
const QString &subset );
353 virtual QString subsetString()
const;
384 virtual QVariantMap extraMetadata()
const;
422 static QCache<QgsPointCloudCacheKey, QgsPointCloudBlock>
sBlockCache;
445 operator bool()
const;
457 void load(
const QString &url,
const QString &authcfg = QString() );
464 bool isValid()
const;
471 QString error()
const;
495 qint64 pointCount()
const;
502 QVariantMap originalMetadata()
const;
578 bool updateNodeData(
const QHash<QgsPointCloudNodeId, QByteArray> &data );
636 bool setSubsetString(
const QString &subset );
644 QString subsetString()
const;
668 QVariantMap extraMetadata()
const;
676 bool commitChanges( QString *errorMessage
SIP_OUT =
nullptr );
679 bool isModified()
const;
682 QList<QgsPointCloudNodeId> updatedNodes()
const;
697 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.
QString uri() const
Returns the URI used to load the index.
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.
virtual std::unique_ptr< QgsPointCloudBlock > nodeData(QgsPointCloudNodeId n, const QgsPointCloudRequest &request)=0
Returns node data block.
QgsPointCloudExpression mFilterExpression
The filter expression to be evaluated when fetching node data.
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 QgsPointCloudBlockRequest * asyncNodeData(QgsPointCloudNodeId n, const QgsPointCloudRequest &request)=0
Returns a handle responsible for loading a node data block.
virtual bool updateNodeData(const QHash< QgsPointCloudNodeId, QByteArray > &data)
Tries to update the data for the specified nodes.
static QCache< QgsPointCloudCacheKey, QgsPointCloudBlock > sBlockCache
virtual bool needsHierarchyFetching(const QgsPointCloudNodeId &) const
Returns whether calling getNode() for node will trigger a hierarchy page fetch.
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.
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(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.
QgsPointCloudNode(QgsPointCloudNodeId id, qint64 pointCount, const QList< QgsPointCloudNodeId > &childIds, float error, const QgsBox3D &bounds)
Constructs new node object.
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...
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...
uint qHash(const QVariant &variant)
Hash for QVariant.
#define SIP_NODEFAULTCTORS
Q_DECLARE_TYPEINFO(QgsPointCloudNodeId, Q_PRIMITIVE_TYPE)
size_t qHash(QgsPointCloudNodeId id, size_t seed=0)
Hash function for indexed nodes.