QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
src
core
geometry
qgsbox3d.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsbox3d.h
3
----------
4
begin : April 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSBOX3D_H
19
#define QGSBOX3D_H
20
21
#include "qgis_core.h"
22
#include "
qgsrectangle.h
"
23
24
#include <QVector3D>
25
26
#include "
qgspoint.h
"
27
38
class
CORE_EXPORT
QgsBox3d
39
{
40
public
:
41
45
QgsBox3d
(
double
xmin = 0,
double
ymin = 0,
double
zmin = 0,
double
xmax = 0,
double
ymax = 0,
double
zmax = 0 )
SIP_HOLDGIL
;
46
51
QgsBox3d
(
const
QgsPoint
&p1,
const
QgsPoint
&p2 )
SIP_HOLDGIL
;
52
57
QgsBox3d
(
const
QgsRectangle
&rect )
SIP_HOLDGIL
;
58
64
void
setXMinimum(
double
x )
SIP_HOLDGIL
;
65
71
void
setXMaximum(
double
x )
SIP_HOLDGIL
;
72
78
double
xMinimum()
const
SIP_HOLDGIL
{
return
mBounds2d.xMinimum(); }
79
85
double
xMaximum()
const
SIP_HOLDGIL
{
return
mBounds2d.xMaximum(); }
86
92
void
setYMinimum(
double
y )
SIP_HOLDGIL
;
93
99
void
setYMaximum(
double
y )
SIP_HOLDGIL
;
100
106
double
yMinimum()
const
SIP_HOLDGIL
{
return
mBounds2d.yMinimum(); }
107
113
double
yMaximum()
const
SIP_HOLDGIL
{
return
mBounds2d.yMaximum(); }
114
120
void
setZMinimum(
double
z )
SIP_HOLDGIL
;
121
127
void
setZMaximum(
double
z )
SIP_HOLDGIL
;
128
134
double
zMinimum()
const
SIP_HOLDGIL
{
return
mZmin; }
135
141
double
zMaximum()
const
SIP_HOLDGIL
{
return
mZmax; }
142
146
void
normalize();
147
153
double
width() const
SIP_HOLDGIL
{
return
mBounds2d.width(); }
154
160
double
height() const
SIP_HOLDGIL
{
return
mBounds2d.height(); }
161
167
double
depth() const
SIP_HOLDGIL
{
return
mZmax - mZmin; }
168
172
double
volume() const
SIP_HOLDGIL
{
return
mBounds2d.area() * ( mZmax - mZmin ); }
173
177
QgsBox3d
intersect(
const
QgsBox3d
&other )
const
;
178
183
bool
is2d() const
SIP_HOLDGIL
;
184
188
bool
intersects( const
QgsBox3d
&other ) const;
189
193
bool
contains( const
QgsBox3d
&other ) const;
194
201
bool
contains( const
QgsPoint
&point ) const;
202
206
QgsRectangle
toRectangle()
const
{
return
mBounds2d; }
207
214
double
distanceTo(
const
QVector3D &point )
const
;
215
216
bool
operator==
(
const
QgsBox3d
&other )
const
;
217
225
void
scale(
double
scaleFactor,
const
QgsPoint
¢er =
QgsPoint
() );
226
232
void
scale(
double
scaleFactor,
double
centerX,
double
centerY,
double
centerZ );
233
234
private
:
235
236
QgsRectangle
mBounds2d;
237
double
mZmin = 0.0;
238
double
mZmax = 0.0;
239
240
};
241
242
#endif // QGSBOX3D_H
qgsrectangle.h
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition:
qgsfeatureiterator.h:425
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition:
qgspoint.h:48
qgspoint.h
QgsRectangle
A rectangle specified with double values.
Definition:
qgsrectangle.h:41
SIP_HOLDGIL
#define SIP_HOLDGIL
Definition:
qgis_sip.h:166
QgsBox3d
A 3-dimensional box composed of x, y, z coordinates.
Definition:
qgsbox3d.h:38
Generated on Sun Sep 11 2022 00:03:17 for QGIS API Documentation by
1.8.17