QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgsraycastcontext.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsraycastcontext.cpp
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#include "qgsraycastcontext.h"
17
18#include <algorithm>
19
21{
22 mSingleResult = enable;
23}
24
26{
27 return mSingleResult;
28}
29
31{
32 return mMaxDistance;
33}
34
36{
37 mMaxDistance = distance;
38}
39
41{
42 mAngleThreshold = std::clamp( angle, 0.f, 90.f );
43}
44
46{
47 return mAngleThreshold;
48}
float angleThreshold() const
Sets an angle threshold in degrees for ray intersections, effectively turning a ray into a cone.
float maximumDistance() const
The maximum distance from ray origin to look for hits when casting a ray.
bool singleResult() const
Returns whether to fetch only the closest hit for each layer or entity type.
void setSingleResult(bool enable)
Sets whether to fetch only the closest hit for each layer or entity type.
void setMaximumDistance(float distance)
Sets the maximum distance from ray origin to look for hits when casting a ray.
void setAngleThreshold(float angle)
Sets an angle threshold in degrees for ray intersections, effectively turning a ray into a cone.