QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsRayCastHit Class Reference

Contains details about the ray intersecting entities when ray casting in a 3D map canvas. More...

#include <qgsraycasthit.h>

Public Member Functions

 QgsRayCastHit ()=default
double distance () const
 Returns the hit's distance from the ray's origin.
QgsVector3D mapCoordinates () const
 Returns the hit position in 3d map coordinates.
QVariantMap properties () const
 Returns a map with the properties of the intersected entity.
void setDistance (double distance)
 Sets the hit's distance from the ray's origin.
void setMapCoordinates (const QgsVector3D &point)
 Sets the hit point position in 3d map coordinates.
void setProperties (const QVariantMap &attributes)
 Sets the point cloud point attributes, empty map if hit was not on a point cloud point.

Detailed Description

Contains details about the ray intersecting entities when ray casting in a 3D map canvas.

Since
QGIS 4.0

Definition at line 34 of file qgsraycasthit.h.

Constructor & Destructor Documentation

◆ QgsRayCastHit()

QgsRayCastHit::QgsRayCastHit ( )
default

Member Function Documentation

◆ distance()

double QgsRayCastHit::distance ( ) const

Returns the hit's distance from the ray's origin.

Definition at line 18 of file qgsraycasthit.cpp.

◆ mapCoordinates()

QgsVector3D QgsRayCastHit::mapCoordinates ( ) const

Returns the hit position in 3d map coordinates.

Definition at line 23 of file qgsraycasthit.cpp.

◆ properties()

QVariantMap QgsRayCastHit::properties ( ) const

Returns a map with the properties of the intersected entity.

For vector layer hits, the FID value is stored in key "fid". For point cloud layer hits, it contains the point attributes keys/values. For tiled scene layer hits, it contains the intersecting node details.

Definition at line 28 of file qgsraycasthit.cpp.

◆ setDistance()

void QgsRayCastHit::setDistance ( double distance)

Sets the hit's distance from the ray's origin.

Definition at line 33 of file qgsraycasthit.cpp.

◆ setMapCoordinates()

void QgsRayCastHit::setMapCoordinates ( const QgsVector3D & point)

Sets the hit point position in 3d map coordinates.

Definition at line 38 of file qgsraycasthit.cpp.

◆ setProperties()

void QgsRayCastHit::setProperties ( const QVariantMap & attributes)

Sets the point cloud point attributes, empty map if hit was not on a point cloud point.

Definition at line 43 of file qgsraycasthit.cpp.


The documentation for this class was generated from the following files: