QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
pointcloud
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 "
qgspointcloudblock.h
"
19
20
#include "
qgis.h
"
21
#include "
qgspointcloudattribute.h
"
22
23
QgsPointCloudBlock::QgsPointCloudBlock
(
int
count,
const
QgsPointCloudAttributeCollection
&
attributes
,
const
QByteArray &
data
,
const
QgsVector3D
&
scale
,
const
QgsVector3D
&
offset
)
24
: mPointCount( count )
25
, mAttributes(
attributes
)
26
, mRecordSize( mAttributes.
pointRecordSize
() )
27
, mStorage(
data
)
28
, mScale(
scale
)
29
, mOffset(
offset
)
30
{}
31
32
QgsPointCloudBlock
*
QgsPointCloudBlock::clone
()
const
33
{
34
return
new
QgsPointCloudBlock
( *
this
);
35
}
36
37
const
char
*
QgsPointCloudBlock::data
()
const
38
{
39
return
mStorage.data();
40
}
41
42
int
QgsPointCloudBlock::pointCount
()
const
43
{
44
return
mPointCount;
45
}
46
47
QgsPointCloudAttributeCollection
QgsPointCloudBlock::attributes
()
const
48
{
49
return
mAttributes;
50
}
51
52
QgsVector3D
QgsPointCloudBlock::scale
()
const
53
{
54
return
mScale;
55
}
56
57
QgsVector3D
QgsPointCloudBlock::offset
()
const
58
{
59
return
mOffset;
60
}
61
62
void
QgsPointCloudBlock::setPointCount
(
int
size )
63
{
64
if
( size < 0 )
65
return
;
66
mPointCount = size;
67
mStorage.resize( size * mAttributes.pointRecordSize() );
68
}
QgsPointCloudAttributeCollection
A collection of point cloud attributes.
Definition
qgspointcloudattribute.h:157
QgsPointCloudBlock::QgsPointCloudBlock
QgsPointCloudBlock(int count, const QgsPointCloudAttributeCollection &attributes, const QByteArray &data, const QgsVector3D &scale, const QgsVector3D &offset)
Ctor.
Definition
qgspointcloudblock.cpp:23
QgsPointCloudBlock::setPointCount
void setPointCount(int size)
Changes the number of points in the block.
Definition
qgspointcloudblock.cpp:62
QgsPointCloudBlock::scale
QgsVector3D scale() const
Returns the custom scale of the block.
Definition
qgspointcloudblock.cpp:52
QgsPointCloudBlock::data
const char * data() const
Returns raw pointer to data.
Definition
qgspointcloudblock.cpp:37
QgsPointCloudBlock::attributes
QgsPointCloudAttributeCollection attributes() const
Returns the attributes that are stored in the data block, along with their size.
Definition
qgspointcloudblock.cpp:47
QgsPointCloudBlock::pointCount
int pointCount() const
Returns number of points that are stored in the block.
Definition
qgspointcloudblock.cpp:42
QgsPointCloudBlock::pointRecordSize
int pointRecordSize() const
Returns the total size of each individual point record.
Definition
qgspointcloudblock.h:64
QgsPointCloudBlock::clone
QgsPointCloudBlock * clone() const
Clones the QgsPointCloudBlock returning a new copy.
Definition
qgspointcloudblock.cpp:32
QgsPointCloudBlock::offset
QgsVector3D offset() const
Returns the custom offset of the block.
Definition
qgspointcloudblock.cpp:57
QgsVector3D
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition
qgsvector3d.h:33
qgis.h
qgspointcloudattribute.h
qgspointcloudblock.h
Generated on
for QGIS API Documentation by
1.17.0