QGIS API Documentation  3.11.0-Master (68611307d7)
Public Member Functions | List of all members
QgsBox3d Class Reference

A 3-dimensional box composed of x, y, z coordinates. More...

#include <qgsbox3d.h>

Public Member Functions

 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. More...
 
 QgsBox3d (const QgsPoint &p1, const QgsPoint &p2)
 Constructs a QgsBox3D from two points representing opposite corners of the box. More...
 
 QgsBox3d (const QgsRectangle &rect)
 Constructs a QgsBox3D from a rectangle. 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
 Returns the depth of the box. More...
 
double height () const
 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
 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)
 Sets the maximum x value. More...
 
void setXMinimum (double x)
 Sets the minimum x value. More...
 
void setYMaximum (double y)
 Sets the maximum y value. More...
 
void setYMinimum (double y)
 Sets the minimum y value. More...
 
void setZMaximum (double z)
 Sets the maximum z value. More...
 
void setZMinimum (double z)
 Sets the minimum z value. More...
 
QgsRectangle toRectangle () const
 Converts the box to a 2D rectangle. More...
 
double volume () const
 Returns the volume of the box. More...
 
double width () const
 Returns the width of the box. More...
 
double xMaximum () const
 Returns the maximum x value. More...
 
double xMinimum () const
 Returns the minimum x value. More...
 
double yMaximum () const
 Returns the maximum y value. More...
 
double yMinimum () const
 Returns the minimum y value. More...
 
double zMaximum () const
 Returns the maximum z value. More...
 
double zMinimum () const
 Returns the minimum z value. More...
 

Detailed Description

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.

See also
QgsRectangle
Since
QGIS 3.0

Definition at line 36 of file qgsbox3d.h.

Constructor & Destructor Documentation

◆ QgsBox3d() [1/3]

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 22 of file qgsbox3d.cpp.

◆ QgsBox3d() [2/3]

QgsBox3d::QgsBox3d ( const QgsPoint p1,
const QgsPoint p2 
)

Constructs a QgsBox3D from two points representing opposite corners of the box.

The box is normalized after construction.

Definition at line 28 of file qgsbox3d.cpp.

◆ QgsBox3d() [3/3]

QgsBox3d::QgsBox3d ( const QgsRectangle rect)

Constructs a QgsBox3D from a rectangle.

Z Minimum and Z Maximum are set to 0.0.

Definition at line 36 of file qgsbox3d.cpp.

Member Function Documentation

◆ contains() [1/2]

bool QgsBox3d::contains ( const QgsBox3d other) const

Returns true when box contains other box.

Definition at line 103 of file qgsbox3d.cpp.

◆ contains() [2/2]

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 111 of file qgsbox3d.cpp.

◆ depth()

double QgsBox3d::depth ( ) const
inline

Returns the depth of the box.

See also
width()
height()

Definition at line 165 of file qgsbox3d.h.

◆ height()

double QgsBox3d::height ( ) const
inline

Returns the height of the box.

See also
width()
depth()

Definition at line 158 of file qgsbox3d.h.

◆ intersect()

QgsBox3d QgsBox3d::intersect ( const QgsBox3d other) const

Returns the intersection of this box and another 3D box.

Definition at line 79 of file qgsbox3d.cpp.

◆ intersects()

bool QgsBox3d::intersects ( const QgsBox3d other) const

Returns true if box intersects with another box.

Definition at line 93 of file qgsbox3d.cpp.

◆ is2d()

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 88 of file qgsbox3d.cpp.

◆ normalize()

void QgsBox3d::normalize ( )

Normalize the box so it has non-negative width/height/depth.

Definition at line 70 of file qgsbox3d.cpp.

◆ operator==()

bool QgsBox3d::operator== ( const QgsBox3d other) const

Definition at line 122 of file qgsbox3d.cpp.

◆ setXMaximum()

void QgsBox3d::setXMaximum ( double  x)

Sets the maximum x value.

See also
xMaximum()
setXMinimum()

Definition at line 45 of file qgsbox3d.cpp.

◆ setXMinimum()

void QgsBox3d::setXMinimum ( double  x)

Sets the minimum x value.

See also
xMinimum()
setXMaximum()

Definition at line 40 of file qgsbox3d.cpp.

◆ setYMaximum()

void QgsBox3d::setYMaximum ( double  y)

Sets the maximum y value.

See also
yMaximum()
setYMinimum()

Definition at line 55 of file qgsbox3d.cpp.

◆ setYMinimum()

void QgsBox3d::setYMinimum ( double  y)

Sets the minimum y value.

See also
yMinimum()
setYMaximum()

Definition at line 50 of file qgsbox3d.cpp.

◆ setZMaximum()

void QgsBox3d::setZMaximum ( double  z)

Sets the maximum z value.

See also
zMaximum()
setZMinimum()

Definition at line 65 of file qgsbox3d.cpp.

◆ setZMinimum()

void QgsBox3d::setZMinimum ( double  z)

Sets the minimum z value.

See also
zMinimum()
setZMaximum()

Definition at line 60 of file qgsbox3d.cpp.

◆ toRectangle()

QgsRectangle QgsBox3d::toRectangle ( ) const
inline

Converts the box to a 2D rectangle.

Definition at line 204 of file qgsbox3d.h.

◆ volume()

double QgsBox3d::volume ( ) const
inline

Returns the volume of the box.

Definition at line 170 of file qgsbox3d.h.

◆ width()

double QgsBox3d::width ( ) const
inline

Returns the width of the box.

See also
height()
depth()

Definition at line 151 of file qgsbox3d.h.

◆ xMaximum()

double QgsBox3d::xMaximum ( ) const
inline

Returns the maximum x value.

See also
setXMaximum()
xMinimum()

Definition at line 83 of file qgsbox3d.h.

◆ xMinimum()

double QgsBox3d::xMinimum ( ) const
inline

Returns the minimum x value.

See also
setXMinimum()
xMaximum()

Definition at line 76 of file qgsbox3d.h.

◆ yMaximum()

double QgsBox3d::yMaximum ( ) const
inline

Returns the maximum y value.

See also
setYMaximum()
yMinimum()

Definition at line 111 of file qgsbox3d.h.

◆ yMinimum()

double QgsBox3d::yMinimum ( ) const
inline

Returns the minimum y value.

See also
setYMinimum()
yMaximum()

Definition at line 104 of file qgsbox3d.h.

◆ zMaximum()

double QgsBox3d::zMaximum ( ) const
inline

Returns the maximum z value.

See also
setZMaximum()
zMinimum()

Definition at line 139 of file qgsbox3d.h.

◆ zMinimum()

double QgsBox3d::zMinimum ( ) const
inline

Returns the minimum z value.

See also
setZMinimum()
zMaximum()

Definition at line 132 of file qgsbox3d.h.


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