QGIS API Documentation 3.43.0-Master (ebb4087afc0)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QgsAABB Class Reference

3 More...

#include <qgsaabb.h>

Public Member Functions

 QgsAABB ()=default
 Constructs bounding box with null coordinates.
 
 QgsAABB (float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
 Constructs bounding box.
 
QVector3D center () const
 Returns coordinates of the center of the box.
 
float distanceFromPoint (float x, float y, float z) const
 Returns shortest distance from the box to a point.
 
float distanceFromPoint (QVector3D v) const
 Returns shortest distance from the box to a point.
 
bool intersects (const QgsAABB &other) const
 Determines whether the box intersects some other axis aligned box.
 
bool intersects (float x, float y, float z) const
 Determines whether given coordinate is inside the box.
 
bool isEmpty () const
 Returns true if xExtent(), yExtent() and zExtent() are all zero, false otherwise.
 
QVector3D maximum () const
 Returns corner of the box with maximal coordinates.
 
QVector3D minimum () const
 Returns corner of the box with minimal coordinates.
 
QString toString () const
 Returns text representation of the bounding box.
 
QList< QVector3D > verticesForLines () const
 Returns a list of pairs of vertices (useful for display of bounding boxes)
 
float xCenter () const
 Returns center in X axis.
 
float xExtent () const
 Returns box width in X axis.
 
float yCenter () const
 Returns center in Y axis.
 
float yExtent () const
 Returns box width in Y axis.
 
float zCenter () const
 Returns center in Z axis.
 
float zExtent () const
 Returns box width in Z axis.
 

Static Public Member Functions

static QgsAABB fromBox3D (const QgsBox3D &box3D, const QgsVector3D &origin)
 Constructs bounding box from QgsBox3D by subtracting origin 3D vector.
 

Public Attributes

float xMax = 0.0f
 
float xMin = 0.0f
 
float yMax = 0.0f
 
float yMin = 0.0f
 
float zMax = 0.0f
 
float zMin = 0.0f
 

Detailed Description

3

Axis-aligned bounding box - in world coords.

Note
Not available in Python bindings

Definition at line 34 of file qgsaabb.h.

Constructor & Destructor Documentation

◆ QgsAABB() [1/2]

QgsAABB::QgsAABB ( )
default

Constructs bounding box with null coordinates.

◆ QgsAABB() [2/2]

QgsAABB::QgsAABB ( float  xMin,
float  yMin,
float  zMin,
float  xMax,
float  yMax,
float  zMax 
)

Constructs bounding box.

Definition at line 18 of file qgsaabb.cpp.

Member Function Documentation

◆ center()

QVector3D QgsAABB::center ( ) const
inline

Returns coordinates of the center of the box.

Definition at line 68 of file qgsaabb.h.

◆ distanceFromPoint() [1/2]

float QgsAABB::distanceFromPoint ( float  x,
float  y,
float  z 
) const

Returns shortest distance from the box to a point.

Definition at line 46 of file qgsaabb.cpp.

◆ distanceFromPoint() [2/2]

float QgsAABB::distanceFromPoint ( QVector3D  v) const

Returns shortest distance from the box to a point.

Definition at line 54 of file qgsaabb.cpp.

◆ fromBox3D()

static QgsAABB QgsAABB::fromBox3D ( const QgsBox3D box3D,
const QgsVector3D origin 
)
inlinestatic

Constructs bounding box from QgsBox3D by subtracting origin 3D vector.

Note: this is potentially lossy operation as the coordinates are converted from double values to floats!

Definition at line 48 of file qgsaabb.h.

◆ intersects() [1/2]

bool QgsAABB::intersects ( const QgsAABB other) const

Determines whether the box intersects some other axis aligned box.

Definition at line 35 of file qgsaabb.cpp.

◆ intersects() [2/2]

bool QgsAABB::intersects ( float  x,
float  y,
float  z 
) const

Determines whether given coordinate is inside the box.

Definition at line 40 of file qgsaabb.cpp.

◆ isEmpty()

bool QgsAABB::isEmpty ( ) const
inline

Returns true if xExtent(), yExtent() and zExtent() are all zero, false otherwise.

Definition at line 93 of file qgsaabb.h.

◆ maximum()

QVector3D QgsAABB::maximum ( ) const
inline

Returns corner of the box with maximal coordinates.

Definition at line 72 of file qgsaabb.h.

◆ minimum()

QVector3D QgsAABB::minimum ( ) const
inline

Returns corner of the box with minimal coordinates.

Definition at line 70 of file qgsaabb.h.

◆ toString()

QString QgsAABB::toString ( ) const

Returns text representation of the bounding box.

Definition at line 92 of file qgsaabb.cpp.

◆ verticesForLines()

QList< QVector3D > QgsAABB::verticesForLines ( ) const

Returns a list of pairs of vertices (useful for display of bounding boxes)

Definition at line 59 of file qgsaabb.cpp.

◆ xCenter()

float QgsAABB::xCenter ( ) const
inline

Returns center in X axis.

Definition at line 61 of file qgsaabb.h.

◆ xExtent()

float QgsAABB::xExtent ( ) const
inline

Returns box width in X axis.

Definition at line 54 of file qgsaabb.h.

◆ yCenter()

float QgsAABB::yCenter ( ) const
inline

Returns center in Y axis.

Definition at line 63 of file qgsaabb.h.

◆ yExtent()

float QgsAABB::yExtent ( ) const
inline

Returns box width in Y axis.

Definition at line 56 of file qgsaabb.h.

◆ zCenter()

float QgsAABB::zCenter ( ) const
inline

Returns center in Z axis.

Definition at line 65 of file qgsaabb.h.

◆ zExtent()

float QgsAABB::zExtent ( ) const
inline

Returns box width in Z axis.

Definition at line 58 of file qgsaabb.h.

Member Data Documentation

◆ xMax

float QgsAABB::xMax = 0.0f

Definition at line 101 of file qgsaabb.h.

◆ xMin

float QgsAABB::xMin = 0.0f

Definition at line 98 of file qgsaabb.h.

◆ yMax

float QgsAABB::yMax = 0.0f

Definition at line 102 of file qgsaabb.h.

◆ yMin

float QgsAABB::yMin = 0.0f

Definition at line 99 of file qgsaabb.h.

◆ zMax

float QgsAABB::zMax = 0.0f

Definition at line 103 of file qgsaabb.h.

◆ zMin

float QgsAABB::zMin = 0.0f

Definition at line 100 of file qgsaabb.h.


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