23 #include <QJsonDocument>
24 #include <QJsonObject>
51 QStringList lst =
str.split(
'-' );
52 if ( lst.count() != 4 )
59 return QStringLiteral(
"%1-%2-%3-%4" ).arg( mD ).arg( mX ).arg( mY ).arg( mZ );
84 return id.d() +
id.x() +
id.y() +
id.z();
139 mXMin * scale.
x() + offset.
x(), mYMin * scale.
y() + offset.
y(),
140 mXMax * scale.
x() + offset.
x(), mYMax * scale.
y() + offset.
y()
146 return QgsDoubleRange( mZMin * scale.
z() + offset.
z(), mZMax * scale.
z() + offset.
z() );
171 QList<IndexedPointCloudNode> lst;
177 for (
int i = 0; i < 8; ++i )
179 int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
195 qint32 xMin = -999999999, yMin = -999999999,
zMin = -999999999;
196 qint32 xMax = 999999999, yMax = 999999999,
zMax = 999999999;
199 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 parentNode() const
Returns the parent of the node.
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.
virtual 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.
virtual bool hasNode(const IndexedPointCloudNode &n) const
Returns whether the octree contain given 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.