PointHit< PointType > Class Template Reference

Describes the interaction of a object and a (templated) point. It carries the info of a successful hit and (if successful) the interaction point. More...

Public Types

typedef PointType point_type
 The point type. More...
 

Public Member Functions

 PointHit ()
 Default construct. A zero point with a large distance, no hit, no eligible misses. More...
 
 PointHit (const point_type &p)
 Construct from point with a large distance, no hit, no eligible misses. More...
 
 PointHit (bool hit, const point_type &p, scalar dist, bool eligibleMiss=false)
 Construct from components. More...
 
bool hit () const noexcept
 Is there a hit. More...
 
bool eligibleMiss () const noexcept
 Is this an eligible miss. More...
 
const point_typepoint () const noexcept
 Return the point, no checks. More...
 
scalar distance () const noexcept
 Return distance to hit. More...
 
const point_typehitPoint () const
 Return the hit point. Fatal if not hit. More...
 
const point_typemissPoint () const
 Return the miss point. Fatal if hit. More...
 
const point_typerawPoint () const noexcept
 The point, no checks. More...
 
void setHit () noexcept
 Set the hit status on. More...
 
void setMiss (const bool eligible) noexcept
 Set the hit status off and set the eligible miss status. More...
 
void setPoint (const point_type &p)
 Set the point. More...
 
void setDistance (const scalar d) noexcept
 Set the distance. More...
 
void hitPoint (const point_type &p)
 Set the point as hit. More...
 
template<class AnyPointType >
bool operator< (const PointHit< AnyPointType > &rhs) const noexcept
 Distance comparision operator, for sorting. More...
 

Detailed Description

template<class PointType>
class Foam::PointHit< PointType >

Describes the interaction of a object and a (templated) point. It carries the info of a successful hit and (if successful) the interaction point.

Definition at line 43 of file pointHit.H.

Member Typedef Documentation

◆ point_type

typedef PointType point_type

The point type.

Definition at line 91 of file pointHit.H.

Constructor & Destructor Documentation

◆ PointHit() [1/3]

PointHit ( )
inline

Default construct. A zero point with a large distance, no hit, no eligible misses.

Definition at line 100 of file pointHit.H.

◆ PointHit() [2/3]

PointHit ( const point_type p)
inlineexplicit

Construct from point with a large distance, no hit, no eligible misses.

Definition at line 112 of file pointHit.H.

◆ PointHit() [3/3]

PointHit ( bool  hit,
const point_type p,
scalar  dist,
bool  eligibleMiss = false 
)
inline

Construct from components.

Definition at line 124 of file pointHit.H.

Member Function Documentation

◆ hit()

◆ eligibleMiss()

bool eligibleMiss ( ) const
inlinenoexcept

◆ point()

◆ distance()

◆ hitPoint() [1/2]

const point_type& hitPoint ( ) const
inline

Return the hit point. Fatal if not hit.

Definition at line 177 of file pointHit.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Referenced by face::intersection(), triangle< Point, PointRef >::nearestPoint(), face::nearestPointClassify(), face::ray(), and triangle< Point, PointRef >::ray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ missPoint()

const point_type& missPoint ( ) const
inline

Return the miss point. Fatal if hit.

Definition at line 192 of file pointHit.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ rawPoint()

const point_type& rawPoint ( ) const
inlinenoexcept

The point, no checks.

Deprecated:
(2020-10) use point()

Definition at line 209 of file pointHit.H.

◆ setHit()

void setHit ( )
inlinenoexcept

Set the hit status on.

Definition at line 217 of file pointHit.H.

Referenced by tetrahedron< Point, PointRef >::containmentSphere().

Here is the caller graph for this function:

◆ setMiss()

void setMiss ( const bool  eligible)
inlinenoexcept

Set the hit status off and set the eligible miss status.

Definition at line 226 of file pointHit.H.

Referenced by tetrahedron< Point, PointRef >::containmentSphere(), triangle< Point, PointRef >::nearestPoint(), face::nearestPointClassify(), face::ray(), and triangle< Point, PointRef >::ray().

Here is the caller graph for this function:

◆ setPoint()

void setPoint ( const point_type p)
inline

◆ setDistance()

void setDistance ( const scalar  d)
inlinenoexcept

◆ hitPoint() [2/2]

void hitPoint ( const point_type p)
inline

Set the point as hit.

Definition at line 251 of file pointHit.H.

References p.

◆ operator<()

bool operator< ( const PointHit< AnyPointType > &  rhs) const
inlinenoexcept

Distance comparision operator, for sorting.

Definition at line 265 of file pointHit.H.


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