QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
qgsfeature3dhandler_p.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfeature3dhandler_p.cpp
3
--------------------------------------
4
Date : January 2019
5
Copyright : (C) 2019 by Martin Dobias
6
Email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
17
#include "
qgsfeature3dhandler_p.h
"
18
19
#include "
qgsgeometry.h
"
20
21
#include <QVector>
22
#include <QVector3D>
23
25
26
void
QgsFeature3DHandler::updateZRangeFromPositions(
const
QVector<QVector3D> &positions )
27
{
28
for
(
const
QVector3D &pos : positions )
29
{
30
if
( pos.z() < mZMin )
31
mZMin = pos.z();
32
if
( pos.z() > mZMax )
33
mZMax = pos.z();
34
}
35
}
36
37
bool
QgsFeature3DHandler::clipGeometryIfTooLarge(
QgsGeometry
&geom )
const
38
{
39
// let's clip gigantic geometries to the chunk's extents
40
const
QgsRectangle
bbox = geom.
boundingBox
();
41
if
( bbox.
width
() > MAX_GEOM_BBOX_SIZE || bbox.
height
() > MAX_GEOM_BBOX_SIZE )
42
{
43
geom = geom.
clipped
( mChunkExtent.toRectangle() );
44
return
true
;
45
}
46
return
false
;
47
}
48
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:267
QgsGeometry::clipped
QgsGeometry clipped(const QgsRectangle &rectangle, QgsFeedback *feedback=nullptr)
Clips the geometry using the specified rectangle.
Definition
qgsgeometry.cpp:4210
QgsGeometry::boundingBox
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
Definition
qgsgeometry.cpp:1543
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
QgsRectangle::height
double height
Definition
qgsrectangle.h:55
QgsRectangle::width
double width
Definition
qgsrectangle.h:54
qgsfeature3dhandler_p.h
qgsgeometry.h
Generated on
for QGIS API Documentation by
1.17.0