NDEVR
API Documentation

A Model which represents everything that is visible from a certain vantage point. More...

Public Member Functions

 LineOfSight ()
 Default constructor.
 LineOfSight (const Model &parent)
 Constructs a LineOfSight as a child of the given parent Model.
void clearMesh ()
 Removes all vertices and primitives from the current scan mesh geometry.
void createLineOfSight (LineOfSightArgs &args)
 Executes a full line-of-sight analysis.
LineOfSightArgs currentArgs () const
 Retrieves the current analysis parameters from the Model's stored metadata and effect transforms.
void intersectMeshes (LineOfSightArgs &args)
 Performs ray-scene intersection for every ray in the scan mesh.
bool intersects (SelectionInfo &info, const LineOfSightArgs &args)
 Tests whether a single selection ray intersects scene geometry.
Model losLayer () const
 Returns (or creates) the scene layer used to render line-of-sight results.

Static Public Member Functions

static const char * TypeName ()
 Returns the unique type identifier string for LineOfSight Models.

Detailed Description

A Model which represents everything that is visible from a certain vantage point.


LineOfSight extends Scan to cast rays outward from an observer origin across a configurable angular field of view. Each ray is intersected against the scene geometry to determine the nearest visible surface, producing a mesh that represents the visible area.

Definition at line 35 of file LineOfSight.h.

Constructor & Destructor Documentation

◆ LineOfSight() [1/2]

LineOfSight::LineOfSight ( )
inline

Default constructor.


Creates an uninitialised LineOfSight object.

Definition at line 41 of file LineOfSight.h.

◆ LineOfSight() [2/2]

LineOfSight::LineOfSight ( const Model & parent)

Constructs a LineOfSight as a child of the given parent Model.


If the Model does not already carry the "line_of_sight" type tag, this constructor initialises display properties (name, icon, material, layer) and configures parent- matrix flags so that the analysis is independent of parent offset, scale, and rotation.

Parameters
[in]parentThe parent Model under which this LineOfSight is created.

Member Function Documentation

◆ clearMesh()

void LineOfSight::clearMesh ( )

Removes all vertices and primitives from the current scan mesh geometry.


◆ createLineOfSight()

void LineOfSight::createLineOfSight ( LineOfSightArgs & args)

Executes a full line-of-sight analysis.


Clears any existing mesh, configures scan parameters from args, generates the ray mesh, intersects all scene geometry, and updates the resulting visibility surface.

Parameters
[in]argsThe analysis parameters. args.lookup must not be null.

◆ currentArgs()

LineOfSightArgs LineOfSight::currentArgs ( ) const

Retrieves the current analysis parameters from the Model's stored metadata and effect transforms.


Returns
A LineOfSightArgs populated with the origin, angular bounds, and distance bounds currently persisted in this Model.

◆ intersectMeshes()

void LineOfSight::intersectMeshes ( LineOfSightArgs & args)

Performs ray-scene intersection for every ray in the scan mesh.


Iterates over the internal mesh write queue, casting each ray from the origin and recording the nearest intersection distance. Uses multi-threaded processing when NDEVR_SUPPORTS_THREADING is enabled.

Parameters
[in]argsThe analysis parameters including origin, distance bounds, and lookup.

◆ intersects()

bool LineOfSight::intersects ( SelectionInfo & info,
const LineOfSightArgs & args )

Tests whether a single selection ray intersects scene geometry.


Parameters
[in]infoThe SelectionInfo describing the ray or region to test; updated in place with the nearest hit result.
[in]argsThe analysis parameters providing the DesignObjectLookup for scene queries.
Returns
True if a valid intersection was found, false otherwise.

◆ losLayer()

Model LineOfSight::losLayer ( ) const

Returns (or creates) the scene layer used to render line-of-sight results.


The layer is identified by a deterministic UUID derived from "Line of Sight". If it does not yet exist, a new layer with color-by-model material settings is created.

Returns
The Model representing the line-of-sight scene layer.

◆ TypeName()

const char * LineOfSight::TypeName ( )
inlinestatic

Returns the unique type identifier string for LineOfSight Models.


Returns
A null-terminated C string: "line_of_sight".

Definition at line 59 of file LineOfSight.h.


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