QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgspointcloudblock.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudblock.cpp
3 -----------------------
4 begin : October 2020
5 copyright : (C) 2020 by Peter Petrik
6 email : zilolv at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include "qgis.h"
19#include "qgspointcloudblock.h"
21
22
24 int count,
25 const QgsPointCloudAttributeCollection &attributes,
26 const QByteArray &data, const QgsVector3D &scale, const QgsVector3D &offset
27)
28 : mPointCount( count )
29 , mAttributes( attributes )
30 , mRecordSize( mAttributes.pointRecordSize() )
31 , mStorage( data )
32 , mScale( scale )
33 , mOffset( offset )
34{
35}
36
38{
39 return new QgsPointCloudBlock( *this );
40}
41
42const char *QgsPointCloudBlock::data() const
43{
44 return mStorage.data();
45}
46
48{
49 return mPointCount;
50}
51
53{
54 return mAttributes;
55}
56
58{
59 return mScale;
60}
61
63{
64 return mOffset;
65}
66
68{
69 if ( size < 0 )
70 return;
71 mPointCount = size;
72 mStorage.resize( size * mAttributes.pointRecordSize() );
73}
Collection of point cloud attributes.
int pointRecordSize() const
Returns total size of record.
Base class for storing raw data from point cloud nodes.
QgsPointCloudBlock(int count, const QgsPointCloudAttributeCollection &attributes, const QByteArray &data, const QgsVector3D &scale, const QgsVector3D &offset)
Ctor.
void setPointCount(int size)
Changes the number of points in the block.
QgsVector3D scale() const
Returns the custom scale of the block.
const char * data() const
Returns raw pointer to data.
QgsPointCloudAttributeCollection attributes() const
Returns the attributes that are stored in the data block, along with their size.
int pointCount() const
Returns number of points that are stored in the block.
QgsPointCloudBlock * clone() const
Clones the QgsPointCloudBlock returning a new copy.
QgsVector3D offset() const
Returns the custom offset of the block.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
Definition: qgsvector3d.h:31