EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
EBGeometry::RaySpansT< T > Struct Template Reference

Where a ray is inside an object over an interval [t0, t1]: its spans, in order, each from where it enters to where it leaves, complete up to a horizon. More...

#include <EBGeometry_Ray.hpp>

Collaboration diagram for EBGeometry::RaySpansT< T >:
Collaboration graph
[legend]

Classes

struct  Span
 A span: where the ray enters, and where it leaves. More...
 

Public Member Functions

void reset (T a_horizon) noexcept
 Empty the list, complete up to a horizon.
 
void add (const SpanEndT< T > &a_in, const SpanEndT< T > &a_out) noexcept
 Append a span after the last one, or, if the list is full, drop it and lower the horizon to where it begins.
 
void addClipped (T a_in, T a_out, T a_t0, T a_t1) noexcept
 Append the span [a_in, a_out] cut to [a_t0, a_t1]: an end outside it (or infinite) becomes an Open end there. Nothing is added if the span misses the interval.
 

Public Attributes

Span m_spans [Capacity]
 The spans, in order and disjoint.
 
uint32_t m_count = 0
 How many are held.
 
T m_horizon = Math::Limits<T>::infinity()
 The list is complete on [t0, m_horizon]: nothing about the object beyond it is known.
 

Static Public Attributes

static constexpr uint32_t Capacity = 8
 Most spans held.
 

Detailed Description

template<class T>
struct EBGeometry::RaySpansT< T >

Where a ray is inside an object over an interval [t0, t1]: its spans, in order, each from where it enters to where it leaves, complete up to a horizon.

A span that begins before t0 begins at t0 with an Open end, and one that ends after t1 ends at t1 with an Open end. The list holds at most Capacity spans. Past that, add() drops a span and lowers the horizon to where it begins: the list is then complete only on [t0, m_horizon], and a query needing more starts again from the horizon. A shape whose ray form only finds the first crossing (see RayForm) describes the interval up to it in the same way.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ add()

template<class T >
void EBGeometry::RaySpansT< T >::add ( const SpanEndT< T > &  a_in,
const SpanEndT< T > &  a_out 
)
inlinenoexcept

Append a span after the last one, or, if the list is full, drop it and lower the horizon to where it begins.

Parameters
[in]a_inWhere the ray enters.
[in]a_outWhere it leaves.

◆ addClipped()

template<class T >
void EBGeometry::RaySpansT< T >::addClipped ( T  a_in,
T  a_out,
T  a_t0,
T  a_t1 
)
inlinenoexcept

Append the span [a_in, a_out] cut to [a_t0, a_t1]: an end outside it (or infinite) becomes an Open end there. Nothing is added if the span misses the interval.

Parameters
[in]a_inWhere the ray enters (or -infinity); above a_out for a ray that misses.
[in]a_outWhere it leaves (or +infinity).
[in]a_t0Start of the interval.
[in]a_t1End of the interval.

◆ reset()

template<class T >
void EBGeometry::RaySpansT< T >::reset ( T  a_horizon)
inlinenoexcept

Empty the list, complete up to a horizon.

Parameters
[in]a_horizonHorizon: the end of the interval, for a list that will be complete.

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