QGIS API Documentation 3.41.0-Master (d2aaa9c6e02)
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
QgsPointCloudIndex Class Reference

Smart pointer for QgsAbstractPointCloudIndex. More...

#include <qgspointcloudindex.h>

Public Member Functions

 QgsPointCloudIndex (QgsAbstractPointCloudIndex *index=nullptr)
 Construct wrapper, takes ownership of index.
 
Qgis::PointCloudAccessType accessType () const
 Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP server either synchronously or asynchronously If the access type is local, the data is stored locally as a file and will only be fetch synchronously ( blocking request with nodeData only )
 
QgsPointCloudBlockRequestasyncNodeData (const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)
 Returns a handle responsible for loading a node data block.
 
QgsPointCloudAttributeCollection attributes () const
 Returns all attributes that are stored in the file.
 
bool commitChanges (QString *errorMessage=nullptr)
 Tries to store pending changes to the data provider.
 
QgsCoordinateReferenceSystem crs () const
 Returns the coordinate reference system of the point cloud index.
 
QString error () const
 Returns the error that occurred during the loading of the index.
 
QgsRectangle extent () const
 Returns extent of the data.
 
QVariantMap extraMetadata () const
 Returns extra metadata that's not accessible through the other methods in an implementation-specific dynamic structure.
 
QgsAbstractPointCloudIndexget ()
 Returns pointer to the implementation class.
 
QgsPointCloudNode getNode (const QgsPointCloudNodeId &id) const
 Returns object for a given node.
 
QgsPointCloudBlockgetNodeDataFromCache (const QgsPointCloudNodeId &node, const QgsPointCloudRequest &request)
 Fetches the requested node data from the cache for the specified node and request.
 
bool hasNode (const QgsPointCloudNodeId &id) const
 Returns whether the octree contain given node.
 
bool isModified () const
 Returns true if there are uncommitted changes, false otherwise.
 
bool isValid () const
 Returns whether index is loaded and valid.
 
void load (const QString &fileName)
 Loads the index from the file.
 
QgsPointCloudStatistics metadataStatistics () const
 Returns the object containing the statistics metadata extracted from the dataset.
 
std::unique_ptr< QgsPointCloudBlocknodeData (const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)
 Returns node data block.
 
QgsVector3D offset () const
 Returns offset of data from CRS.
 
 operator bool () const
 Checks if index is non-null.
 
QVariantMap originalMetadata () const
 Returns the original metadata map.
 
qint64 pointCount () const
 Returns the number of points in the point cloud.
 
QgsPointCloudNodeId root () const
 Returns root node of the index.
 
QgsBox3D rootNodeBounds () const
 Returns bounding box of root node in CRS coords.
 
QgsVector3D scale () const
 Returns scale of data relative to CRS.
 
bool setSubsetString (const QString &subset)
 Sets the string used to define a subset of the point cloud.
 
int span () const
 Returns the number of points in one direction in a single node.
 
void storeNodeDataToCache (QgsPointCloudBlock *data, const QgsPointCloudNodeId &node, const QgsPointCloudRequest &request)
 Stores existing data to the cache for the specified node and request.
 
QString subsetString () const
 Returns the string used to define a subset of the point cloud.
 
bool updateNodeData (const QHash< QgsPointCloudNodeId, QByteArray > &data)
 Tries to update the data for the specified nodes.
 
bool writeStatistics (QgsPointCloudStatistics &stats)
 Writes the statistics object stats into the backing file, if possible.
 
double zMax () const
 Returns z max.
 
double zMin () const
 Returns z min.
 

Friends

class TestQgsPointCloudEditing
 

Detailed Description

Smart pointer for QgsAbstractPointCloudIndex.

This is a wrapper for QgsAbstractPointCloudIndex, an index for point cloud layers. It contains a shared_pointer, ensuring that concurrent access to the index is memory safe.

Since
QGIS 3.42

Definition at line 416 of file qgspointcloudindex.h.

Constructor & Destructor Documentation

◆ QgsPointCloudIndex()

QgsPointCloudIndex::QgsPointCloudIndex ( QgsAbstractPointCloudIndex index = nullptr)
explicit

Construct wrapper, takes ownership of index.

Definition at line 331 of file qgspointcloudindex.cpp.

Member Function Documentation

◆ accessType()

Qgis::PointCloudAccessType QgsPointCloudIndex::accessType ( ) const

Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP server either synchronously or asynchronously If the access type is local, the data is stored locally as a file and will only be fetch synchronously ( blocking request with nodeData only )

Note
Always make sure to check before trying to use asyncNodeData since it is not supported in the case of local access type
See also
QgsAbstractPointCloudIndex::accessType

Definition at line 357 of file qgspointcloudindex.cpp.

◆ asyncNodeData()

QgsPointCloudBlockRequest * QgsPointCloudIndex::asyncNodeData ( const QgsPointCloudNodeId n,
const QgsPointCloudRequest request 
)

Returns a handle responsible for loading a node data block.

e.g. positions (needs to be scaled and offset applied to get coordinates) or classification, intensity or custom attributes

It is caller responsibility to free the handle and the block issued by the handle if the loading succeeds.

May return nullptr in case the node is not present or any other problem with loading

See also
QgsAbstractPointCloudIndex::asyncNodeData

Definition at line 423 of file qgspointcloudindex.cpp.

◆ attributes()

QgsPointCloudAttributeCollection QgsPointCloudIndex::attributes ( ) const

Returns all attributes that are stored in the file.

See also
QgsAbstractPointCloudIndex::attributes

Definition at line 411 of file qgspointcloudindex.cpp.

◆ commitChanges()

bool QgsPointCloudIndex::commitChanges ( QString *  errorMessage = nullptr)

Tries to store pending changes to the data provider.

If errorMessage is not a null pointer, it will receive an error message in case the call failed.

Returns
true on success, otherwise false

Definition at line 507 of file qgspointcloudindex.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsPointCloudIndex::crs ( ) const

Returns the coordinate reference system of the point cloud index.

See also
QgsAbstractPointCloudIndex::crs

Definition at line 363 of file qgspointcloudindex.cpp.

◆ error()

QString QgsPointCloudIndex::error ( ) const

Returns the error that occurred during the loading of the index.

See also
QgsAbstractPointCloudIndex::error

Definition at line 352 of file qgspointcloudindex.cpp.

◆ extent()

QgsRectangle QgsPointCloudIndex::extent ( ) const

Returns extent of the data.

See also
QgsAbstractPointCloudIndex::extent

Definition at line 435 of file qgspointcloudindex.cpp.

◆ extraMetadata()

QVariantMap QgsPointCloudIndex::extraMetadata ( ) const

Returns extra metadata that's not accessible through the other methods in an implementation-specific dynamic structure.

See also
QgsAbstractPointCloudIndex::extraMetadata

Definition at line 501 of file qgspointcloudindex.cpp.

◆ get()

QgsAbstractPointCloudIndex * QgsPointCloudIndex::get ( )
inline

Returns pointer to the implementation class.

Definition at line 426 of file qgspointcloudindex.h.

◆ getNode()

QgsPointCloudNode QgsPointCloudIndex::getNode ( const QgsPointCloudNodeId id) const

Returns object for a given node.

See also
QgsAbstractPointCloudIndex::getNode

Definition at line 405 of file qgspointcloudindex.cpp.

◆ getNodeDataFromCache()

QgsPointCloudBlock * QgsPointCloudIndex::getNodeDataFromCache ( const QgsPointCloudNodeId node,
const QgsPointCloudRequest request 
)

Fetches the requested node data from the cache for the specified node and request.

If not found in the cache, nullptr is returned. Caller takes ownership of the returned object.

See also
QgsAbstractPointCloudIndex::getNodeDataFromCache

Definition at line 489 of file qgspointcloudindex.cpp.

◆ hasNode()

bool QgsPointCloudIndex::hasNode ( const QgsPointCloudNodeId id) const

Returns whether the octree contain given node.

See also
QgsAbstractPointCloudIndex::hasNode

Definition at line 399 of file qgspointcloudindex.cpp.

◆ isModified()

bool QgsPointCloudIndex::isModified ( ) const

Returns true if there are uncommitted changes, false otherwise.

Definition at line 516 of file qgspointcloudindex.cpp.

◆ isValid()

bool QgsPointCloudIndex::isValid ( ) const

Returns whether index is loaded and valid.

See also
QgsAbstractPointCloudIndex::isValid

Definition at line 347 of file qgspointcloudindex.cpp.

◆ load()

void QgsPointCloudIndex::load ( const QString &  fileName)

Loads the index from the file.

See also
QgsAbstractPointCloudIndex::load

Definition at line 341 of file qgspointcloudindex.cpp.

◆ metadataStatistics()

QgsPointCloudStatistics QgsPointCloudIndex::metadataStatistics ( ) const

Returns the object containing the statistics metadata extracted from the dataset.

See also
QgsAbstractPointCloudIndex::metadataStatistics

Definition at line 381 of file qgspointcloudindex.cpp.

◆ nodeData()

std::unique_ptr< QgsPointCloudBlock > QgsPointCloudIndex::nodeData ( const QgsPointCloudNodeId n,
const QgsPointCloudRequest request 
)

Returns node data block.

e.g. positions (needs to be scaled and offset applied to get coordinates) or classification, intensity or custom attributes.

May return nullptr in case the node is not present or any other problem with loading

See also
QgsAbstractPointCloudIndex::nodeData

Definition at line 417 of file qgspointcloudindex.cpp.

◆ offset()

QgsVector3D QgsPointCloudIndex::offset ( ) const

Returns offset of data from CRS.

See also
QgsAbstractPointCloudIndex::offset

Definition at line 464 of file qgspointcloudindex.cpp.

◆ operator bool()

QgsPointCloudIndex::operator bool ( ) const

Checks if index is non-null.

Definition at line 336 of file qgspointcloudindex.cpp.

◆ originalMetadata()

QVariantMap QgsPointCloudIndex::originalMetadata ( ) const

Returns the original metadata map.

See also
QgsAbstractPointCloudIndex::originalMetadata

Definition at line 375 of file qgspointcloudindex.cpp.

◆ pointCount()

qint64 QgsPointCloudIndex::pointCount ( ) const

Returns the number of points in the point cloud.

See also
QgsAbstractPointCloudIndex::pointCount

Definition at line 369 of file qgspointcloudindex.cpp.

◆ root()

QgsPointCloudNodeId QgsPointCloudIndex::root ( ) const

Returns root node of the index.

See also
QgsAbstractPointCloudIndex::root

Definition at line 393 of file qgspointcloudindex.cpp.

◆ rootNodeBounds()

QgsBox3D QgsPointCloudIndex::rootNodeBounds ( ) const

Returns bounding box of root node in CRS coords.

See also
QgsAbstractPointCloudIndex::rootNodeBounds

Definition at line 452 of file qgspointcloudindex.cpp.

◆ scale()

QgsVector3D QgsPointCloudIndex::scale ( ) const

Returns scale of data relative to CRS.

See also
QgsAbstractPointCloudIndex::scale

Definition at line 458 of file qgspointcloudindex.cpp.

◆ setSubsetString()

bool QgsPointCloudIndex::setSubsetString ( const QString &  subset)

Sets the string used to define a subset of the point cloud.

Parameters
subsetThe subset string to be used in a QgsPointCloudExpression
Returns
true if the expression is parsed with no errors, false otherwise
See also
QgsAbstractPointCloudIndex::setSubsetString

Definition at line 477 of file qgspointcloudindex.cpp.

◆ span()

int QgsPointCloudIndex::span ( ) const

Returns the number of points in one direction in a single node.

See also
QgsAbstractPointCloudIndex::span

Definition at line 470 of file qgspointcloudindex.cpp.

◆ storeNodeDataToCache()

void QgsPointCloudIndex::storeNodeDataToCache ( QgsPointCloudBlock data,
const QgsPointCloudNodeId node,
const QgsPointCloudRequest request 
)

Stores existing data to the cache for the specified node and request.

Ownership is not transferred, block gets cloned in the cache.

See also
QgsAbstractPointCloudIndex::storeNodeDataToCache

Definition at line 495 of file qgspointcloudindex.cpp.

◆ subsetString()

QString QgsPointCloudIndex::subsetString ( ) const

Returns the string used to define a subset of the point cloud.

Returns
The subset string or null QString if not implemented by the provider
See also
QgsAbstractPointCloudIndex::subsetString

Definition at line 483 of file qgspointcloudindex.cpp.

◆ updateNodeData()

bool QgsPointCloudIndex::updateNodeData ( const QHash< QgsPointCloudNodeId, QByteArray > &  data)

Tries to update the data for the specified nodes.

Returns
true on success, otherwise false

Definition at line 429 of file qgspointcloudindex.cpp.

◆ writeStatistics()

bool QgsPointCloudIndex::writeStatistics ( QgsPointCloudStatistics stats)

Writes the statistics object stats into the backing file, if possible.

Returns true if the data was written successfully.

See also
QgsAbstractPointCloudIndex::writeStatistics

Definition at line 387 of file qgspointcloudindex.cpp.

◆ zMax()

double QgsPointCloudIndex::zMax ( ) const

Returns z max.

See also
QgsAbstractPointCloudIndex::zMax

Definition at line 446 of file qgspointcloudindex.cpp.

◆ zMin()

double QgsPointCloudIndex::zMin ( ) const

Returns z min.

See also
QgsAbstractPointCloudIndex::zMin

Definition at line 441 of file qgspointcloudindex.cpp.

Friends And Related Symbol Documentation

◆ TestQgsPointCloudEditing

friend class TestQgsPointCloudEditing
friend

Definition at line 661 of file qgspointcloudindex.h.


The documentation for this class was generated from the following files: