34 uint64_t blockOffset, int32_t blockSize,
int pointCount,
const QgsLazInfo &lazInfo )
36 mBlockOffset( blockOffset ), mBlockSize( blockSize ), mPointCount( pointCount ), mLazInfo( lazInfo )
38 QNetworkRequest nr( mUri );
39 nr.setAttribute( QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache );
40 nr.setAttribute( QNetworkRequest::CacheSaveControlAttribute,
true );
42 QByteArray queryRange = QStringLiteral(
"bytes=%1-%2" ).arg( mBlockOffset ).arg( ( int64_t ) mBlockOffset + mBlockSize - 1 ).toLocal8Bit();
43 nr.setRawHeader(
"Range", queryRange );
49void QgsCopcPointCloudBlockRequest::blockFinishedLoading()
57 error = QStringLiteral(
"Returned HTTP range is incorrect, requested %1 bytes but got %2 bytes" ).arg( mBlockSize ).arg(
mTileDownloadManagerReply->data().size() );
65 catch ( std::exception &e )
67 error = QStringLiteral(
"Decompression error: %1" ).arg( e.what() );
75 if ( !error.isEmpty() )
Represents a indexed point cloud node in octree.
QString toString() const
Encode node to string.
static QgsTileDownloadManager * tileDownloadManager()
Returns the application's tile download manager, used for download of map tiles when rendering.
QgsCopcPointCloudBlockRequest(const IndexedPointCloudNode &node, const QString &Uri, const QgsPointCloudAttributeCollection &attributes, const QgsPointCloudAttributeCollection &requestedAttributes, const QgsVector3D &scale, const QgsVector3D &offset, const QgsPointCloudExpression &filterExpression, const QgsRectangle &filterRect, uint64_t blockOffset, int32_t blockSize, int pointCount, const QgsLazInfo &lazInfo)
QgsPointCloudBlockRequest constructor Requests the block data of size blockSize at offset blockOffset...
Class for extracting information contained in LAZ file such as the public header block and variable l...
Collection of point cloud attributes.
Base class for handling loading QgsPointCloudBlock asynchronously.
QgsPointCloudAttributeCollection mRequestedAttributes
QgsPointCloudBlock * mBlock
std::unique_ptr< QgsTileDownloadManagerReply > mTileDownloadManagerReply
IndexedPointCloudNode mNode
QgsPointCloudExpression mFilterExpression
void finished()
Emitted when the request processing has finished.
A rectangle specified with double values.
void finished()
Emitted when the reply has finished (either with a success or with a failure)