QGIS API Documentation
4.3.0-Master (8c22baaae17)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
chunks
qgschunkboundsentity_p.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgschunkboundsentity_p.cpp
3
--------------------------------------
4
Date : July 2017
5
Copyright : (C) 2017 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
#include "
qgschunkboundsentity_p.h
"
17
18
#include "
qgs3dwiredmesh_p.h
"
19
#include "
qgsaabb.h
"
20
#include "
qgsbox3d.h
"
21
#include "
qgsgeotransform.h
"
22
#include "
qgsunlitmaterial.h
"
23
24
#include "moc_qgschunkboundsentity_p.cpp"
25
27
28
QgsChunkBoundsEntity::QgsChunkBoundsEntity(
const
QgsVector3D
&vertexDataOrigin, Qt3DCore::QNode *parent )
29
:
Qt3DCore
::QEntity( parent )
30
, mVertexDataOrigin( vertexDataOrigin )
31
{
32
mAabbMesh =
new
Qgs3DWiredMesh;
33
addComponent( mAabbMesh );
34
35
auto
*bboxesMaterial =
new
QgsUnlitMaterial();
36
bboxesMaterial->setColor( Qt::red );
37
bboxesMaterial->setCastsShadows(
false
);
38
addComponent( bboxesMaterial );
39
40
QgsGeoTransform *transform =
new
QgsGeoTransform;
41
transform->setGeoTranslation( mVertexDataOrigin );
42
addComponent( transform );
43
}
44
45
void
QgsChunkBoundsEntity::setBoxes(
const
QList<QgsBox3D> &bboxes )
46
{
47
QList<QgsAABB> aabbBoxes;
48
for
(
const
QgsBox3D
&box : bboxes )
49
{
50
aabbBoxes <<
QgsAABB::fromBox3D
( box, mVertexDataOrigin );
51
}
52
mAabbMesh->setVertices( aabbBoxes );
53
}
54
QgsAABB::fromBox3D
static QgsAABB fromBox3D(const QgsBox3D &box3D, const QgsVector3D &origin)
Constructs bounding box from QgsBox3D by subtracting origin 3D vector.
Definition
qgsaabb.h:46
QgsBox3D
A 3-dimensional box composed of x, y, z coordinates.
Definition
qgsbox3d.h:45
QgsVector3D
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition
qgsvector3d.h:33
Qt3DCore
Definition
qgsabstract3drenderer.h:33
qgs3dwiredmesh_p.h
qgsaabb.h
qgsbox3d.h
qgschunkboundsentity_p.h
qgsgeotransform.h
qgsunlitmaterial.h
Generated on
for QGIS API Documentation by
1.17.0