19#include "moc_qgscopcpointcloudblockrequest.cpp"
37 uint64_t blockOffset, int32_t blockSize,
int pointCount,
const QgsLazInfo &lazInfo )
39 mBlockOffset( blockOffset ), mBlockSize( blockSize ), mPointCount( pointCount ), mLazInfo( lazInfo )
42 Q_ASSERT( mBlockSize > 0 );
44 QNetworkRequest nr = QNetworkRequest( QUrl( mUri ) );
47 nr.setAttribute( QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache );
48 nr.setAttribute( QNetworkRequest::CacheSaveControlAttribute,
true );
50 QByteArray queryRange = QStringLiteral(
"bytes=%1-%2" ).arg( mBlockOffset ).arg( ( int64_t ) mBlockOffset + mBlockSize - 1 ).toLocal8Bit();
51 nr.setRawHeader(
"Range", queryRange );
57void QgsCopcPointCloudBlockRequest::blockFinishedLoading()
65 error = QStringLiteral(
"Returned HTTP range is incorrect, requested %1 bytes but got %2 bytes" ).arg( mBlockSize ).arg(
mTileDownloadManagerReply->data().size() );
77 catch ( std::exception &e )
79 error = QStringLiteral(
"Decompression error: %1" ).arg( e.what() );
87 if ( !error.isEmpty() )
static void storeNodeDataToCacheStatic(QgsPointCloudBlock *data, const QgsPointCloudNodeId &node, const QgsPointCloudRequest &request, const QgsPointCloudExpression &expression, const QString &uri)
Stores existing data to the cache for the specified node, request, expression and uri.
static QgsTileDownloadManager * tileDownloadManager()
Returns the application's tile download manager, used for download of map tiles when rendering.
QgsCopcPointCloudBlockRequest(const QgsPointCloudNodeId &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...
Extracts information contained in a LAZ file, such as the public header block and variable length rec...
A collection of point cloud attributes.
Base class for handling loading QgsPointCloudBlock asynchronously.
QgsPointCloudAttributeCollection mRequestedAttributes
std::unique_ptr< QgsTileDownloadManagerReply > mTileDownloadManagerReply
std::unique_ptr< QgsPointCloudBlock > mBlock
QgsPointCloudNodeId mNode
QgsPointCloudExpression mFilterExpression
void finished()
Emitted when the request processing has finished.
Represents an indexed point cloud node's position in octree.
QString toString() const
Encode node to string.
Point cloud data request.
void setFilterRect(QgsRectangle extent)
Sets the rectangle from which points will be taken, in point cloud's crs.
void setAttributes(const QgsPointCloudAttributeCollection &attributes)
Set attributes filter in the request.
A rectangle specified with double values.
void finished()
Emitted when the reply has finished (either with a success or with a failure)
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
#define QgsSetRequestInitiatorClass(request, _class)
#define QgsSetRequestInitiatorId(request, str)