QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Member Functions | Public Attributes | List of all members
QgsAABB Class Reference

3 Axis-aligned bounding box - in world coords. More...

#include <qgsaabb.h>

Public Member Functions

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

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.

Since
QGIS 3.0

Definition at line 30 of file qgsaabb.h.

Constructor & Destructor Documentation

QgsAABB::QgsAABB ( )
default

Constructs bounding box with null coordinates.

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

QVector3D QgsAABB::center ( ) const
inline

Returns coordinates of the center of the box.

Definition at line 54 of file qgsaabb.h.

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

Returns shortest distance from the box to a point.

Definition at line 50 of file qgsaabb.cpp.

float QgsAABB::distanceFromPoint ( QVector3D  v) const

Returns shortest distance from the box to a point.

Definition at line 58 of file qgsaabb.cpp.

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.

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

Determines whether given coordinate is inside the box.

Definition at line 42 of file qgsaabb.cpp.

QVector3D QgsAABB::maximum ( ) const
inline

Returns corner of the box with maximal coordinates.

Definition at line 58 of file qgsaabb.h.

QVector3D QgsAABB::minimum ( ) const
inline

Returns corner of the box with minimal coordinates.

Definition at line 56 of file qgsaabb.h.

QList< QVector3D > QgsAABB::verticesForLines ( ) const

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

Definition at line 63 of file qgsaabb.cpp.

float QgsAABB::xCenter ( ) const
inline

Returns center in X axis.

Definition at line 47 of file qgsaabb.h.

float QgsAABB::xExtent ( ) const
inline

Returns box width in X axis.

Definition at line 40 of file qgsaabb.h.

float QgsAABB::yCenter ( ) const
inline

Returns center in Y axis.

Definition at line 49 of file qgsaabb.h.

float QgsAABB::yExtent ( ) const
inline

Returns box width in Y axis.

Definition at line 42 of file qgsaabb.h.

float QgsAABB::zCenter ( ) const
inline

Returns center in Z axis.

Definition at line 51 of file qgsaabb.h.

float QgsAABB::zExtent ( ) const
inline

Returns box width in Z axis.

Definition at line 44 of file qgsaabb.h.

Member Data Documentation

float QgsAABB::xMax = 0.0f

Definition at line 78 of file qgsaabb.h.

float QgsAABB::xMin = 0.0f

Definition at line 75 of file qgsaabb.h.

float QgsAABB::yMax = 0.0f

Definition at line 79 of file qgsaabb.h.

float QgsAABB::yMin = 0.0f

Definition at line 76 of file qgsaabb.h.

float QgsAABB::zMax = 0.0f

Definition at line 80 of file qgsaabb.h.

float QgsAABB::zMin = 0.0f

Definition at line 77 of file qgsaabb.h.


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