Class: QgsRayCastResult¶
Contains the results of ray casting operations in a 3D map canvas.
Added in version 4.0.
Methods
| Adds all hits from layer to the result | |
| Adds all terrain hits to the result | |
| Returns all the hits from both layer and terrain intersections | |
| Returns  | |
| Returns  | |
| Returns  | |
| Returns all hits from entities of the specific layer | |
| Returns pointers to the map layers of entities that were intersected by the ray | |
| Returns all terrain intersection hits | 
- class qgis._3d.QgsRayCastResult[source]¶
- Bases: - object- __init__()
- Ctor 
 - __init__(a0: QgsRayCastResult)
- Parameters:
- a0 (QgsRayCastResult) 
 
 - addLayerHits(self, layer: QgsMapLayer | None, hits: Iterable[QgsRayCastHit])[source]¶
- Adds all - hitsfrom- layerto the result- Parameters:
- layer (Optional[QgsMapLayer]) 
- hits (Iterable[QgsRayCastHit]) 
 
 
 - addTerrainHits(self, hits: Iterable[QgsRayCastHit])[source]¶
- Adds all terrain - hitsto the result- Parameters:
- hits (Iterable[QgsRayCastHit]) 
 
 - allHits(self) List[QgsRayCastHit]¶
- Returns all the hits from both layer and terrain intersections - Return type:
- List[QgsRayCastHit] 
 
 - hasLayerHits(self) bool[source]¶
- Returns - Trueis ray hit at least one entity from a layer- Return type:
- bool 
 
 - hasTerrainHits(self) bool[source]¶
- Returns - Trueis the ray intersected the terrain- Return type:
- bool 
 
 - isEmpty(self) bool[source]¶
- Returns - Trueis ray did not intersect any layer or terrain entity- Return type:
- bool 
 
 - layerHits(self, layer: QgsMapLayer | None) List[QgsRayCastHit]¶
- Returns all hits from entities of the specific - layer- Parameters:
- layer (Optional[QgsMapLayer]) 
- Return type:
- List[QgsRayCastHit] 
 
 - layers(self) List[QgsMapLayer]¶
- Returns pointers to the map layers of entities that were intersected by the ray - Return type:
- List[QgsMapLayer] 
 
 - terrainHits(self) List[QgsRayCastHit]¶
- Returns all terrain intersection hits - Return type:
- List[QgsRayCastHit]