QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
QgsOrientedBox3D Class Reference

Represents a oriented (rotated) box in 3 dimensions. More...

#include <qgsorientedbox3d.h>

Public Member Functions

 QgsOrientedBox3D ()
 Constructor for a null oriented box.
 QgsOrientedBox3D (const QgsVector3D &center, const QgsVector3D &halfSizes, const QQuaternion &quaternion)
 Constructor for a oriented box, with a specified center, half sizes in each dimension and rotation.
 QgsOrientedBox3D (const QgsVector3D &center, const QList< QgsVector3D > &halfAxes)
 Constructor for a oriented box, with a specified center and half axes matrix.
 QgsOrientedBox3D (const QList< double > &center, const QList< double > &halfAxes)
 Constructor for a oriented box, with a specified center and half axes matrix.
QgsVector3D center () const
 Returns the vector to the center of the box.
double centerX () const
 Returns the center x-coordinate.
double centerY () const
 Returns the center y-coordinate.
double centerZ () const
 Returns the center z-coordinate.
QVector< QgsVector3Dcorners () const
 Returns an array of all corners as 3D vectors.
QgsBox3D extent () const
 Returns the overall bounding box of the object.
const double * halfAxes () const
 Returns the half axes matrix;.
QList< double > halfAxesList () const
 Returns the half axes matrix;.
bool intersects (const QgsOrientedBox3D &other) const
 Returns true if the box intersects the other box.
bool isNull () const
 Returns true if the box is a null box.
double longestSide () const
 Returns size of the longest side of the box.
bool operator!= (const QgsOrientedBox3D &other) const
bool operator== (const QgsOrientedBox3D &other) const
QgsBox3D reprojectedExtent (const QgsCoordinateTransform &ct) const
 Reprojects corners of this box using the given coordinate transform and returns axis-aligned box containing reprojected corners.
QgsVector3D size () const
 Returns size of sides of the box.
QgsOrientedBox3D transformed (const QgsMatrix4x4 &transform) const
 Returns box transformed by a 4x4 matrix.

Static Public Member Functions

static QgsOrientedBox3D fromBox3D (const QgsBox3D &box)
 Constructs an oriented box from an axis-aligned bounding box.

Friends

class QgsCesiumUtils

Detailed Description

Represents a oriented (rotated) box in 3 dimensions.

Warning
Non-stable API, exposed to Python for unit testing only.
Since
QGIS 3.34

Definition at line 44 of file qgsorientedbox3d.h.

Constructor & Destructor Documentation

◆ QgsOrientedBox3D() [1/4]

QgsOrientedBox3D::QgsOrientedBox3D ( )
default

Constructor for a null oriented box.

◆ QgsOrientedBox3D() [2/4]

QgsOrientedBox3D::QgsOrientedBox3D ( const QList< double > & center,
const QList< double > & halfAxes )

Constructor for a oriented box, with a specified center and half axes matrix.

Definition at line 30 of file qgsorientedbox3d.cpp.

◆ QgsOrientedBox3D() [3/4]

QgsOrientedBox3D::QgsOrientedBox3D ( const QgsVector3D & center,
const QList< QgsVector3D > & halfAxes )

Constructor for a oriented box, with a specified center and half axes matrix.

Definition at line 47 of file qgsorientedbox3d.cpp.

◆ QgsOrientedBox3D() [4/4]

QgsOrientedBox3D::QgsOrientedBox3D ( const QgsVector3D & center,
const QgsVector3D & halfSizes,
const QQuaternion & quaternion )

Constructor for a oriented box, with a specified center, half sizes in each dimension and rotation.

Since
QGIS 4.0

Definition at line 63 of file qgsorientedbox3d.cpp.

Member Function Documentation

◆ center()

QgsVector3D QgsOrientedBox3D::center ( ) const
inline

Returns the vector to the center of the box.

Definition at line 127 of file qgsorientedbox3d.h.

◆ centerX()

double QgsOrientedBox3D::centerX ( ) const
inline

Returns the center x-coordinate.

See also
centerY()
centerZ()

Definition at line 106 of file qgsorientedbox3d.h.

◆ centerY()

double QgsOrientedBox3D::centerY ( ) const
inline

Returns the center y-coordinate.

See also
centerX()
centerZ()

Definition at line 114 of file qgsorientedbox3d.h.

◆ centerZ()

double QgsOrientedBox3D::centerZ ( ) const
inline

Returns the center z-coordinate.

See also
centerX()
centerY()

Definition at line 122 of file qgsorientedbox3d.h.

◆ corners()

QVector< QgsVector3D > QgsOrientedBox3D::corners ( ) const

Returns an array of all corners as 3D vectors.

Definition at line 128 of file qgsorientedbox3d.cpp.

◆ extent()

QgsBox3D QgsOrientedBox3D::extent ( ) const

Returns the overall bounding box of the object.

Definition at line 109 of file qgsorientedbox3d.cpp.

◆ fromBox3D()

QgsOrientedBox3D QgsOrientedBox3D::fromBox3D ( const QgsBox3D & box)
static

Constructs an oriented box from an axis-aligned bounding box.

Definition at line 83 of file qgsorientedbox3d.cpp.

◆ halfAxes()

const double * QgsOrientedBox3D::halfAxes ( ) const
inline

Returns the half axes matrix;.

Definition at line 132 of file qgsorientedbox3d.h.

◆ halfAxesList()

QList< double > QgsOrientedBox3D::halfAxesList ( ) const

Returns the half axes matrix;.

Definition at line 98 of file qgsorientedbox3d.cpp.

◆ intersects()

bool QgsOrientedBox3D::intersects ( const QgsOrientedBox3D & other) const

Returns true if the box intersects the other box.

Definition at line 208 of file qgsorientedbox3d.cpp.

◆ isNull()

bool QgsOrientedBox3D::isNull ( ) const

Returns true if the box is a null box.

Definition at line 93 of file qgsorientedbox3d.cpp.

◆ longestSide()

double QgsOrientedBox3D::longestSide ( ) const

Returns size of the longest side of the box.

Since
QGIS 4.0

Definition at line 156 of file qgsorientedbox3d.cpp.

◆ operator!=()

bool QgsOrientedBox3D::operator!= ( const QgsOrientedBox3D & other) const
inline

Definition at line 90 of file qgsorientedbox3d.h.

◆ operator==()

bool QgsOrientedBox3D::operator== ( const QgsOrientedBox3D & other) const
inline

Definition at line 74 of file qgsorientedbox3d.h.

◆ reprojectedExtent()

QgsBox3D QgsOrientedBox3D::reprojectedExtent ( const QgsCoordinateTransform & ct) const

Reprojects corners of this box using the given coordinate transform and returns axis-aligned box containing reprojected corners.

Exceptions
QgsCsException

Definition at line 164 of file qgsorientedbox3d.cpp.

◆ size()

QgsVector3D QgsOrientedBox3D::size ( ) const

Returns size of sides of the box.

Definition at line 148 of file qgsorientedbox3d.cpp.

◆ transformed()

QgsOrientedBox3D QgsOrientedBox3D::transformed ( const QgsMatrix4x4 & transform) const

Returns box transformed by a 4x4 matrix.

Definition at line 188 of file qgsorientedbox3d.cpp.

◆ QgsCesiumUtils

friend class QgsCesiumUtils
friend

Definition at line 202 of file qgsorientedbox3d.h.


The documentation for this class was generated from the following files: