QGIS API Documentation
4.3.0-Master (8c22baaae17)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
qgsraycastresult.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsraycastresult.h
3
---------------------
4
begin : September 2025
5
copyright : (C) 2025 by Stefanos Natsis
6
email : uclaros 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
#ifndef QGSRAYCASTRESULT_H
17
#define QGSRAYCASTRESULT_H
18
19
#include "qgis_3d.h"
20
#include "
qgsraycasthit.h
"
21
22
#include <QHash>
23
#include <QList>
24
#include <QPointer>
25
26
class
QgsMapLayer
;
27
28
36
class
_3D_EXPORT
QgsRayCastResult
37
{
38
public
:
40
QgsRayCastResult
();
41
43
bool
isEmpty
()
const
;
44
46
bool
hasLayerHits
()
const
;
47
49
QList<QgsMapLayer *>
layers
()
const
;
50
52
QList<QgsRayCastHit>
layerHits
(
QgsMapLayer
*layer )
const
;
53
55
bool
hasTerrainHits
()
const
;
56
58
QList<QgsRayCastHit>
terrainHits
()
const
;
59
61
QList<QgsRayCastHit>
allHits
()
const
;
62
64
void
addLayerHits
(
QgsMapLayer
*layer,
const
QList<QgsRayCastHit> &hits );
65
67
void
addTerrainHits
(
const
QList<QgsRayCastHit> &hits );
68
69
private
:
70
QHash<QgsMapLayer *, QList<QgsRayCastHit>> mLayerResults;
71
QHash<QgsMapLayer *, QPointer<QgsMapLayer>> mLayerPointers;
72
QList<QgsRayCastHit> mTerrainResults;
73
};
74
75
#endif
// QGSRAYCASTRESULT_H
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsRayCastResult::terrainHits
QList< QgsRayCastHit > terrainHits() const
Returns all terrain intersection hits.
Definition
qgsraycastresult.cpp:53
QgsRayCastResult::layerHits
QList< QgsRayCastHit > layerHits(QgsMapLayer *layer) const
Returns all hits from entities of the specific layer.
Definition
qgsraycastresult.cpp:43
QgsRayCastResult::hasTerrainHits
bool hasTerrainHits() const
Returns true is the ray intersected the terrain.
Definition
qgsraycastresult.cpp:48
QgsRayCastResult::hasLayerHits
bool hasLayerHits() const
Returns true is ray hit at least one entity from a layer.
Definition
qgsraycastresult.cpp:28
QgsRayCastResult::layers
QList< QgsMapLayer * > layers() const
Returns pointers to the map layers of entities that were intersected by the ray.
Definition
qgsraycastresult.cpp:33
QgsRayCastResult::allHits
QList< QgsRayCastHit > allHits() const
Returns all the hits from both layer and terrain intersections.
Definition
qgsraycastresult.cpp:58
QgsRayCastResult::addLayerHits
void addLayerHits(QgsMapLayer *layer, const QList< QgsRayCastHit > &hits)
Adds all hits from layer to the result.
Definition
qgsraycastresult.cpp:70
QgsRayCastResult::addTerrainHits
void addTerrainHits(const QList< QgsRayCastHit > &hits)
Adds all terrain hits to the result.
Definition
qgsraycastresult.cpp:79
QgsRayCastResult::QgsRayCastResult
QgsRayCastResult()
Ctor.
Definition
qgsraycastresult.cpp:20
QgsRayCastResult::isEmpty
bool isEmpty() const
Returns true is ray did not intersect any layer or terrain entity.
Definition
qgsraycastresult.cpp:23
qgsraycasthit.h
Generated on
for QGIS API Documentation by
1.17.0