41 const QVector< QgsVector3D > corners = mBox.corners();
48 for (
int i = 0; i < 8; ++i )
51 x.append( corner.
x() );
52 y.append( corner.
y() );
53 z.append( corner.
z() );
55 transform.transformInPlace( x, y, z, direction );
57 const auto minMaxX = std::minmax_element( x.constBegin(), x.constEnd() );
58 const auto minMaxY = std::minmax_element( y.constBegin(), y.constEnd() );
59 const auto minMaxZ = std::minmax_element( z.constBegin(), z.constEnd() );
60 return QgsBox3D( *minMaxX.first, *minMaxY.first, *minMaxZ.first, *minMaxX.second, *minMaxY.second, *minMaxZ.second );
70 auto polygon = std::make_unique< QgsPolygon >();
72 const QVector< QgsVector3D > corners = mBox.corners();
79 for (
int i = 0; i < 8; ++i )
82 x.append( corner.
x() );
83 y.append( corner.
y() );
84 z.append( corner.
z() );
89 transform.transformInPlace( x, y, z, direction );
92 auto mp = std::make_unique< QgsMultiPoint >( x, y );
99 return mBox.intersects(
box );
TransformDirection
Indicates the direction (forward or inverse) of a transform.
Abstract base class for all geometries.
A 3-dimensional box composed of x, y, z coordinates.
Does vector analysis using the GEOS library and handles import, export, and exception handling.
QgsAbstractGeometry * convexHull(QString *errorMsg=nullptr) const override
Calculate the convex hull of this.
A simple 4x4 matrix implementation useful for transformation in 3D space.
Represents a oriented (rotated) box in 3 dimensions.
QgsOrientedBox3D box() const
Returns the volume's oriented box.
bool intersects(const QgsOrientedBox3D &box) const
Returns true if this bounds intersects the specified box.
QgsTiledSceneBoundingVolume(const QgsOrientedBox3D &box=QgsOrientedBox3D())
Constructor for QgsTiledSceneBoundingVolume, with the specified oriented box.
void transform(const QgsMatrix4x4 &transform)
Applies a transform to the bounding volume.
QgsAbstractGeometry * as2DGeometry(const QgsCoordinateTransform &transform=QgsCoordinateTransform(), Qgis::TransformDirection direction=Qgis::TransformDirection::Forward) const
Returns a new geometry representing the 2-dimensional X/Y center slice of the volume.
QgsBox3D bounds(const QgsCoordinateTransform &transform=QgsCoordinateTransform(), Qgis::TransformDirection direction=Qgis::TransformDirection::Forward) const
Returns the axis aligned bounding box of the volume.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
double y() const
Returns Y coordinate.
double z() const
Returns Z coordinate.
double x() const
Returns X coordinate.