39 QgsAABB(
float xMin,
float yMin,
float zMin,
float xMax,
float yMax,
float zMax );
42 float xExtent()
const {
return xMax - xMin; }
44 float yExtent()
const {
return yMax - yMin; }
46 float zExtent()
const {
return zMax - zMin; }
49 float xCenter()
const {
return ( xMax + xMin ) / 2; }
51 float yCenter()
const {
return ( yMax + yMin ) / 2; }
53 float zCenter()
const {
return ( zMax + zMin ) / 2; }
56 QVector3D
center()
const {
return QVector3D( xCenter(), yCenter(), zCenter() ); }
58 QVector3D
minimum()
const {
return QVector3D( xMin, yMin, zMin ); }
60 QVector3D
maximum()
const {
return QVector3D( xMax, yMax, zMax ); }
63 bool intersects(
const QgsAABB &other )
const;
66 bool intersects(
float x,
float y,
float z )
const;
69 float distanceFromPoint(
float x,
float y,
float z )
const;
72 float distanceFromPoint( QVector3D v )
const;
75 QList<QVector3D> verticesForLines()
const;
78 QString toString()
const;
83 return xMin == xMax && yMin == yMax && zMin == zMax;
float yExtent() const
Returns box width in Y axis.
QVector3D center() const
Returns coordinates of the center of the box.
float xExtent() const
Returns box width in X axis.
float xCenter() const
Returns center in X axis.
float zExtent() const
Returns box width in Z axis.
bool isEmpty() const
Returns true if xExtent(), yExtent() and zExtent() are all zero, false otherwise.
QVector3D minimum() const
Returns corner of the box with minimal coordinates.
float yCenter() const
Returns center in Y axis.
QgsAABB()=default
Constructs bounding box with null coordinates.
QVector3D maximum() const
Returns corner of the box with maximal coordinates.
float zCenter() const
Returns center in Z axis.