23 #include <QJsonDocument>
24 #include <QJsonObject>
44 QStringList lst = str.split(
'-' );
45 if ( lst.count() != 4 )
52 return QStringLiteral(
"%1-%2-%3-%4" ).arg( mD ).arg( mX ).arg( mY ).arg( mZ );
77 return id.d() +
id.x() +
id.y() +
id.z();
132 mXMin * scale.
x() + offset.
x(), mYMin * scale.
y() + offset.
y(),
133 mXMax * scale.
x() + offset.
x(), mYMax * scale.
y() + offset.
y()
139 return QgsDoubleRange( mZMin * scale.
z() + offset.
z(), mZMax * scale.
z() + offset.
z() );
156 QList<IndexedPointCloudNode> lst;
162 for (
int i = 0; i < 8; ++i )
164 int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
179 qint32 xMin = -999999999, yMin = -999999999,
zMin = -999999999;
180 qint32 xMax = 999999999, yMax = 999999999,
zMax = 999999999;
183 double dLevel = ( double )d / pow( 2, n.
d() );
Represents a indexed point cloud node in octree.
static IndexedPointCloudNode fromString(const QString &str)
Creates node from string.
QString toString() const
Encode node to string.
IndexedPointCloudNode()
Constructs invalid node.
QgsRange which stores a range of double values.
Collection of point cloud attributes.
Represents packaged data bounds.
qint32 xMax() const
Returns x max.
qint32 xMin() const
Returns x min.
qint32 yMax() const
Returns y max.
QgsDoubleRange zRange(const QgsVector3D &offset, const QgsVector3D &scale) const
Returns the z range, applying the specified offset and scale.
QgsPointCloudDataBounds()
Constructs invalid bounds.
qint32 zMax() const
Returns z max.
QgsRectangle mapExtent(const QgsVector3D &offset, const QgsVector3D &scale) const
Returns 2D rectangle in map coordinates.
qint32 yMin() const
Returns y min.
qint32 zMin() const
Returns z min.
int span() const
Returns the number of points in one direction in a single node.
double zMax() const
Returns z max.
QgsRectangle nodeMapExtent(const IndexedPointCloudNode &node) const
Returns the extent of a node in map coordinates.
QList< IndexedPointCloudNode > nodeChildren(const IndexedPointCloudNode &n) const
Returns all children of node.
QgsPointCloudIndex()
Constructs index.
double zMin() const
Returns z min.
QgsVector3D offset() const
Returns offset.
QgsVector3D scale() const
Returns scale.
QHash< IndexedPointCloudNode, int > mHierarchy
Data hierarchy.
QgsPointCloudDataBounds mRootBounds
Bounds of the root node's cube (in int32 coordinates)
QgsPointCloudAttributeCollection mAttributes
QgsPointCloudDataBounds nodeBounds(const IndexedPointCloudNode &node) const
Returns bounds of particular node.
QgsVector3D mOffset
Offset of our int32 coordinates compared to CRS coords.
QgsDoubleRange nodeZRange(const IndexedPointCloudNode &node) const
Returns the z range of a node.
int nodePointCount(const IndexedPointCloudNode &n)
Returns the number of poiny of indexed point cloud node n.
float nodeError(const IndexedPointCloudNode &n) const
Returns node's error in map units (used to determine in whether the node has enough detail for the cu...
int mSpan
All native attributes stored in the file.
QgsVector3D mScale
Scale of our int32 coordinates compared to CRS coords.
void setAttributes(const QgsPointCloudAttributeCollection &attributes)
Sets native attributes of the data.
QgsPointCloudAttributeCollection attributes() const
Returns all attributes that are stored in the file.
A rectangle specified with double values.
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
double y() const
Returns Y coordinate.
double z() const
Returns Z coordinate.
double x() const
Returns X coordinate.
uint qHash(IndexedPointCloudNode id)
Hash function for indexed nodes.