QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
A 3-dimensional box composed of x, y, z coordinates. More...
#include <qgsbox3d.h>
Public Member Functions | |
QgsBox3d (const QgsPoint &p1, const QgsPoint &p2) SIP_HOLDGIL | |
Constructs a QgsBox3D from two points representing opposite corners of the box. More... | |
QgsBox3d (const QgsRectangle &rect) SIP_HOLDGIL | |
Constructs a QgsBox3D from a rectangle. More... | |
QgsBox3d (double xmin=0, double ymin=0, double zmin=0, double xmax=0, double ymax=0, double zmax=0) SIP_HOLDGIL | |
Constructor for QgsBox3D which accepts the ranges of x/y/z coordinates. More... | |
bool | contains (const QgsBox3d &other) const |
Returns true when box contains other box. More... | |
bool | contains (const QgsPoint &point) const |
Returns true when box contains a point. More... | |
double | depth () const SIP_HOLDGIL |
Returns the depth of the box. More... | |
double | distanceTo (const QVector3D &point) const |
Returns the smallest distance between the box and the point point (returns 0 if the point is inside the box) More... | |
double | height () const SIP_HOLDGIL |
Returns the height of the box. More... | |
QgsBox3d | intersect (const QgsBox3d &other) const |
Returns the intersection of this box and another 3D box. More... | |
bool | intersects (const QgsBox3d &other) const |
Returns true if box intersects with another box. More... | |
bool | is2d () const SIP_HOLDGIL |
Returns true if the box can be considered a 2-dimensional box, i.e. More... | |
void | normalize () |
Normalize the box so it has non-negative width/height/depth. More... | |
bool | operator== (const QgsBox3d &other) const |
void | setXMaximum (double x) SIP_HOLDGIL |
Sets the maximum x value. More... | |
void | setXMinimum (double x) SIP_HOLDGIL |
Sets the minimum x value. More... | |
void | setYMaximum (double y) SIP_HOLDGIL |
Sets the maximum y value. More... | |
void | setYMinimum (double y) SIP_HOLDGIL |
Sets the minimum y value. More... | |
void | setZMaximum (double z) SIP_HOLDGIL |
Sets the maximum z value. More... | |
void | setZMinimum (double z) SIP_HOLDGIL |
Sets the minimum z value. More... | |
QgsRectangle | toRectangle () const |
Converts the box to a 2D rectangle. More... | |
double | volume () const SIP_HOLDGIL |
Returns the volume of the box. More... | |
double | width () const SIP_HOLDGIL |
Returns the width of the box. More... | |
double | xMaximum () const SIP_HOLDGIL |
Returns the maximum x value. More... | |
double | xMinimum () const SIP_HOLDGIL |
Returns the minimum x value. More... | |
double | yMaximum () const SIP_HOLDGIL |
Returns the maximum y value. More... | |
double | yMinimum () const SIP_HOLDGIL |
Returns the minimum y value. More... | |
double | zMaximum () const SIP_HOLDGIL |
Returns the maximum z value. More... | |
double | zMinimum () const SIP_HOLDGIL |
Returns the minimum z value. More... | |
A 3-dimensional box composed of x, y, z coordinates.
A box composed of x/y/z minimum and maximum values. It is often used to return the 3D extent of a geometry or collection of geometries.
Definition at line 38 of file qgsbox3d.h.
QgsBox3d::QgsBox3d | ( | double | xmin = 0 , |
double | ymin = 0 , |
||
double | zmin = 0 , |
||
double | xmax = 0 , |
||
double | ymax = 0 , |
||
double | zmax = 0 |
||
) |
Constructor for QgsBox3D which accepts the ranges of x/y/z coordinates.
Definition at line 21 of file qgsbox3d.cpp.
Constructs a QgsBox3D from two points representing opposite corners of the box.
The box is normalized after construction.
Definition at line 27 of file qgsbox3d.cpp.
QgsBox3d::QgsBox3d | ( | const QgsRectangle & | rect | ) |
Constructs a QgsBox3D from a rectangle.
Z Minimum and Z Maximum are set to 0.0.
Definition at line 35 of file qgsbox3d.cpp.
bool QgsBox3d::contains | ( | const QgsBox3d & | other | ) | const |
Returns true
when box contains other box.
Definition at line 102 of file qgsbox3d.cpp.
bool QgsBox3d::contains | ( | const QgsPoint & | point | ) | const |
Returns true
when box contains a point.
If the point is a 2D point (no z-coordinate), then the containment test will be performed on the x/y extent of the box only.
Definition at line 110 of file qgsbox3d.cpp.
|
inline |
double QgsBox3d::distanceTo | ( | const QVector3D & | point | ) | const |
Returns the smallest distance between the box and the point point (returns 0 if the point is inside the box)
Definition at line 121 of file qgsbox3d.cpp.
|
inline |
Returns the intersection of this box and another 3D box.
Definition at line 78 of file qgsbox3d.cpp.
bool QgsBox3d::intersects | ( | const QgsBox3d & | other | ) | const |
Returns true
if box intersects with another box.
Definition at line 92 of file qgsbox3d.cpp.
bool QgsBox3d::is2d | ( | ) | const |
Returns true
if the box can be considered a 2-dimensional box, i.e.
it has equal minimum and maximum z values.
Definition at line 87 of file qgsbox3d.cpp.
void QgsBox3d::normalize | ( | ) |
Normalize the box so it has non-negative width/height/depth.
Definition at line 69 of file qgsbox3d.cpp.
bool QgsBox3d::operator== | ( | const QgsBox3d & | other | ) | const |
Definition at line 130 of file qgsbox3d.cpp.
void QgsBox3d::setXMaximum | ( | double | x | ) |
Sets the maximum x value.
Definition at line 44 of file qgsbox3d.cpp.
void QgsBox3d::setXMinimum | ( | double | x | ) |
Sets the minimum x value.
Definition at line 39 of file qgsbox3d.cpp.
void QgsBox3d::setYMaximum | ( | double | y | ) |
Sets the maximum y value.
Definition at line 54 of file qgsbox3d.cpp.
void QgsBox3d::setYMinimum | ( | double | y | ) |
Sets the minimum y value.
Definition at line 49 of file qgsbox3d.cpp.
void QgsBox3d::setZMaximum | ( | double | z | ) |
Sets the maximum z value.
Definition at line 64 of file qgsbox3d.cpp.
void QgsBox3d::setZMinimum | ( | double | z | ) |
Sets the minimum z value.
Definition at line 59 of file qgsbox3d.cpp.
|
inline |
Converts the box to a 2D rectangle.
Definition at line 206 of file qgsbox3d.h.
|
inline |
Returns the volume of the box.
Definition at line 172 of file qgsbox3d.h.
|
inline |
|
inline |
Returns the maximum x value.
Definition at line 85 of file qgsbox3d.h.
|
inline |
Returns the minimum x value.
Definition at line 78 of file qgsbox3d.h.
|
inline |
Returns the maximum y value.
Definition at line 113 of file qgsbox3d.h.
|
inline |
Returns the minimum y value.
Definition at line 106 of file qgsbox3d.h.
|
inline |
Returns the maximum z value.
Definition at line 141 of file qgsbox3d.h.
|
inline |
Returns the minimum z value.
Definition at line 134 of file qgsbox3d.h.