PointIndexHit< PointType > Class Template Reference

This class describes the interaction of an object (often a face) and a point. It carries the info of a successful hit and (if successful), returns the interaction point. More...

Inheritance diagram for PointIndexHit< PointType >:

Public Types

typedef PointType point_type
 The point type. More...
 

Public Member Functions

 PointIndexHit ()
 Default construct. A zero point, with no hit and index = -1. More...
 
 PointIndexHit (const point_type &p)
 Construct from a point, with no hit and index = -1. More...
 
 PointIndexHit (const PointHit< point_type > &p, label index=-1)
 Construct from hitPoint with index = -1 or specified. More...
 
 PointIndexHit (const PointIndexHit< point_type > &p, label index)
 Copy construct with different index. More...
 
 PointIndexHit (bool success, const point_type &p, label index)
 Construct from components. More...
 
 PointIndexHit (Istream &is)
 Construct from Istream. More...
 
bool hit () const noexcept
 Is there a hit? More...
 
label index () const noexcept
 Return the hit index. More...
 
const point_typepoint () const noexcept
 Return point, no checks. More...
 
point_typepoint () noexcept
 Access the point, no checks. More...
 
const point_typehitPoint () const
 Return hit point. Fatal if not hit. More...
 
const point_typemissPoint () const
 Return miss point. Fatal if hit. More...
 
const point_typerawPoint () const noexcept
 The point, no checks. Same as point() More...
 
point_typerawPoint () noexcept
 The point, no checks. Same as point() More...
 
void setHit () noexcept
 Set the hit status on. More...
 
void setMiss () noexcept
 Set the hit status off. More...
 
void setPoint (const point_type &p)
 Set the point. More...
 
void setIndex (const label index) noexcept
 Set the index. More...
 
void hitPoint (const point_type &p)
 Set the point as hit without changing the hit-index. More...
 
void hitPoint (const point_type &p, const label index)
 Set the point as hit and set the hit-index. More...
 
void write (Ostream &os)
 Report hit/miss status, point and index. More...
 
bool operator== (const PointIndexHit &rhs) const
 Test for equality of all components. More...
 
bool operator!= (const PointIndexHit &rhs) const
 Test for inequality of components. More...
 

Friends

Ostreamoperator<< (Ostream &os, const PointIndexHit &pHit)
 
Istreamoperator>> (Istream &is, PointIndexHit &pHit)
 

Detailed Description

template<class PointType>
class Foam::PointIndexHit< PointType >

This class describes the interaction of an object (often a face) and a point. It carries the info of a successful hit and (if successful), returns the interaction point.

Like pointHit but carries object (eg, face, cell, edge etc.) index

Definition at line 44 of file pointIndexHit.H.

Member Typedef Documentation

◆ point_type

typedef PointType point_type

The point type.

Definition at line 93 of file pointIndexHit.H.

Constructor & Destructor Documentation

◆ PointIndexHit() [1/6]

PointIndexHit ( )
inline

Default construct. A zero point, with no hit and index = -1.

Definition at line 101 of file pointIndexHit.H.

◆ PointIndexHit() [2/6]

PointIndexHit ( const point_type p)
inlineexplicit

Construct from a point, with no hit and index = -1.

Definition at line 111 of file pointIndexHit.H.

◆ PointIndexHit() [3/6]

PointIndexHit ( const PointHit< point_type > &  p,
label  index = -1 
)
inlineexplicit

Construct from hitPoint with index = -1 or specified.

Definition at line 121 of file pointIndexHit.H.

◆ PointIndexHit() [4/6]

PointIndexHit ( const PointIndexHit< point_type > &  p,
label  index 
)
inline

Copy construct with different index.

Definition at line 131 of file pointIndexHit.H.

◆ PointIndexHit() [5/6]

PointIndexHit ( bool  success,
const point_type p,
label  index 
)
inline

Construct from components.

Definition at line 141 of file pointIndexHit.H.

◆ PointIndexHit() [6/6]

PointIndexHit ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 151 of file pointIndexHit.H.

Member Function Documentation

◆ hit()

◆ index()

◆ point() [1/2]

◆ point() [2/2]

point_type& point ( )
inlinenoexcept

Access the point, no checks.

Definition at line 188 of file pointIndexHit.H.

◆ hitPoint() [1/3]

const point_type& hitPoint ( ) const
inline

Return hit point. Fatal if not hit.

Definition at line 196 of file pointIndexHit.H.

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

Referenced by searchableBox::findLineAll(), searchableExtrudedCircle::findParametricNearest(), searchableExtrudedCircle::getNormal(), and surfaceIntersection::surfaceIntersection().

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

◆ missPoint()

const point_type& missPoint ( ) const
inline

Return miss point. Fatal if hit.

Definition at line 210 of file pointIndexHit.H.

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

Here is the call graph for this function:

◆ rawPoint() [1/2]

const point_type& rawPoint ( ) const
inlinenoexcept

The point, no checks. Same as point()

Deprecated:
(2020-10) use point()

Definition at line 226 of file pointIndexHit.H.

◆ rawPoint() [2/2]

point_type& rawPoint ( )
inlinenoexcept

The point, no checks. Same as point()

Deprecated:
(2020-10) use point()

Definition at line 233 of file pointIndexHit.H.

◆ setHit()

void setHit ( )
inlinenoexcept

Set the hit status on.

Definition at line 241 of file pointIndexHit.H.

Referenced by triSurfaceTools::classify(), and searchableBox::findLine().

Here is the caller graph for this function:

◆ setMiss()

void setMiss ( )
inlinenoexcept

Set the hit status off.

Definition at line 249 of file pointIndexHit.H.

Referenced by triSurfaceTools::classify(), searchableBox::findNearestOnEdge(), and triSurfaceTools::trackToEdge().

Here is the caller graph for this function:

◆ setPoint()

void setPoint ( const point_type p)
inline

Set the point.

Definition at line 257 of file pointIndexHit.H.

References p.

Referenced by triSurfaceTools::classify().

Here is the caller graph for this function:

◆ setIndex()

void setIndex ( const label  index)
inlinenoexcept

Set the index.

Definition at line 265 of file pointIndexHit.H.

References PointIndexHit< PointType >::index().

Referenced by triSurfaceTools::classify(), searchableBox::findLine(), searchableBox::findNearestOnEdge(), meshSearch::intersection(), and meshSearch::intersections().

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

◆ hitPoint() [2/3]

void hitPoint ( const point_type p)
inline

Set the point as hit without changing the hit-index.

Definition at line 273 of file pointIndexHit.H.

References p.

◆ hitPoint() [3/3]

void hitPoint ( const point_type p,
const label  index 
)
inline

Set the point as hit and set the hit-index.

Definition at line 282 of file pointIndexHit.H.

References PointIndexHit< PointType >::index(), and p.

Here is the call graph for this function:

◆ write()

void write ( Ostream os)
inline

Report hit/miss status, point and index.

Definition at line 295 of file pointIndexHit.H.

References os().

Here is the call graph for this function:

◆ operator==()

bool operator== ( const PointIndexHit< PointType > &  rhs) const
inline

Test for equality of all components.

Definition at line 307 of file pointIndexHit.H.

◆ operator!=()

bool operator!= ( const PointIndexHit< PointType > &  rhs) const
inline

Test for inequality of components.

Definition at line 320 of file pointIndexHit.H.

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream os,
const PointIndexHit< PointType > &  pHit 
)
friend

Definition at line 328 of file pointIndexHit.H.

◆ operator>>

Istream& operator>> ( Istream is,
PointIndexHit< PointType > &  pHit 
)
friend

Definition at line 350 of file pointIndexHit.H.


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