18#ifndef QGSPOINTCLOUDINDEX_H
19#define QGSPOINTCLOUDINDEX_H
37#include "qgspointcloudexpression.h"
71 return mD == other.
d() && mX == other.
x() && mY == other.
y() && mZ == other.
z();
84 QString toString()
const;
99 int mD = -1, mX = -1, mY = -1, mZ = -1;
130 QString
uri()
const {
return mUri; }
142 QgsPointCloudExpression mFilterExpression;
169 const QList<QgsPointCloudNodeId> &childIds,
173 , mPointCount( pointCount )
174 , mChildIds( childIds )
184 QList<QgsPointCloudNodeId>
children()
const {
return mChildIds; }
197 QList<QgsPointCloudNodeId> mChildIds;
226 virtual std::unique_ptr<QgsAbstractPointCloudIndex>
clone()
const = 0;
229 virtual void load(
const QString &fileName ) = 0;
238 QString
error()
const {
return mError; }
309 virtual bool updateNodeData(
const QHash<QgsPointCloudNodeId, QByteArray> &data );
315 double zMin()
const {
return mZMin; }
317 double zMax()
const {
return mZMax; }
339 bool setSubsetString(
const QString &subset );
347 QString subsetString()
const;
371 const QgsPointCloudExpression &expression,
const QString &uri );
379 virtual QVariantMap extraMetadata()
const;
386 double mZMin = 0, mZMax = 0;
400 static QCache<QgsPointCloudCacheKey, QgsPointCloudBlock>
sBlockCache;
423 operator bool()
const;
433 void load(
const QString &fileName );
440 bool isValid()
const;
447 QString error()
const;
471 qint64 pointCount()
const;
478 QVariantMap originalMetadata()
const;
554 bool updateNodeData(
const QHash<QgsPointCloudNodeId, QByteArray> &data );
612 bool setSubsetString(
const QString &subset );
621 QString subsetString()
const;
645 QVariantMap extraMetadata()
const;
653 bool commitChanges( QString *errorMessage
SIP_OUT =
nullptr );
656 bool isModified()
const;
659 std::shared_ptr<QgsAbstractPointCloudIndex> mIndex;
661 friend class TestQgsPointCloudEditing;
PointCloudAccessType
The access type of the data, local is for local files and remote for remote files (over HTTP).
Represents a 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.
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 void load(const QString &fileName)=0
Loads the index from the file.
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...
static QCache< QgsPointCloudCacheKey, QgsPointCloudBlock > sBlockCache
QgsRectangle mExtent
2D extent of data
QString error() const
Returns the error that occurred during the loading of the index.
virtual std::unique_ptr< QgsAbstractPointCloudIndex > clone() const =0
Returns a clone of the current point cloud index object.
QgsPointCloudNodeId root() const
Returns root node of the index.
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.
This class represents a coordinate reference system (CRS).
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.
QgsPointCloudExpression filterExpression() const
Returns the key's QgsPointCloudExpression.
QgsPointCloudCacheKey(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request, const QgsPointCloudExpression &expression, const QString &uri)
Ctor.
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.
Smart pointer for QgsAbstractPointCloudIndex.
QgsAbstractPointCloudIndex * get()
Returns pointer to the implementation class.
Represents a indexed point cloud node's position in octree.
bool isValid() const
Returns whether node is valid.
bool operator==(QgsPointCloudNodeId other) const
Keeps metadata for 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.
Class used to store statistics of a point cloud dataset.
A rectangle specified with double values.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
#define SIP_NODEFAULTCTORS
Q_DECLARE_TYPEINFO(QgsPointCloudNodeId, Q_PRIMITIVE_TYPE)
CORE_EXPORT uint qHash(QgsPointCloudNodeId id)
Hash function for indexed nodes.
const QgsCoordinateReferenceSystem & crs