Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
BVH_Tools< T, N > Class Template Reference

Defines a set of static methods operating with points and bounding boxes. More...

#include <BVH_Tools.hxx>

Public Types

public types
enum  BVH_PrjStateInTriangle { BVH_PrjStateInTriangle_VERTEX , BVH_PrjStateInTriangle_EDGE , BVH_PrjStateInTriangle_INNER }
 
typedef BVH::VectorType< T, N >::Type BVH_VecNt
 

Static Public Member Functions

Box-Box Square distance

Computes Square distance between Axis aligned bounding boxes

staticBoxBoxSquareDistance (const BVH_Box< T, N > &theBox1, const BVH_Box< T, N > &theBox2)
 Computes Square distance between Axis aligned bounding boxes.
 
staticBoxBoxSquareDistance (const BVH_VecNt &theCMin1, const BVH_VecNt &theCMax1, const BVH_VecNt &theCMin2, const BVH_VecNt &theCMax2)
 Computes Square distance between Axis aligned bounding boxes.
 
Point-Box Square distance

Computes square distance between point and bounding box

staticPointBoxSquareDistance (const BVH_VecNt &thePoint, const BVH_Box< T, N > &theBox)
 Computes square distance between point and bounding box.
 
staticPointBoxSquareDistance (const BVH_VecNt &thePoint, const BVH_VecNt &theCMin, const BVH_VecNt &theCMax)
 Computes square distance between point and bounding box.
 
Point-Box projection

Computes projection of point on bounding box

static BVH_VecNt PointBoxProjection (const BVH_VecNt &thePoint, const BVH_Box< T, N > &theBox)
 Computes projection of point on bounding box.
 
static BVH_VecNt PointBoxProjection (const BVH_VecNt &thePoint, const BVH_VecNt &theCMin, const BVH_VecNt &theCMax)
 Computes projection of point on bounding box.
 
Point-Triangle Square distance

Find nearest point on a triangle for the given point. Uses Voronoi region testing to determine closest feature (vertex, edge, or interior).

static BVH_VecNt PointTriangleProjection (const BVH_VecNt &thePoint, const BVH_VecNt &theNode0, const BVH_VecNt &theNode1, const BVH_VecNt &theNode2, BVH_PrjStateInTriangle *thePrjState=nullptr, int *theNumberOfFirstNode=nullptr, int *theNumberOfLastNode=nullptr)
 Computes square distance between point and triangle.
 
staticPointTriangleSquareDistance (const BVH_VecNt &thePoint, const BVH_VecNt &theNode0, const BVH_VecNt &theNode1, const BVH_VecNt &theNode2)
 Computes square distance between point and triangle.
 
Ray-Box Intersection

Computes hit time of ray-box intersection. Uses precomputed reciprocal direction from BVH_Ray for optimal performance.

static bool RayBoxIntersection (const BVH_Ray< T, N > &theRay, const BVH_Box< T, N > &theBox, T &theTimeEnter, T &theTimeLeave)
 Computes hit time of ray-box intersection. Uses precomputed reciprocal direction from BVH_Ray for optimal performance. Handles parallel rays (infinite inverse direction) explicitly to avoid NaN from 0*inf when ray origin is exactly on a slab boundary.
 
static bool RayBoxIntersection (const BVH_Ray< T, N > &theRay, const BVH_VecNt &theBoxCMin, const BVH_VecNt &theBoxCMax, T &theTimeEnter, T &theTimeLeave)
 Computes hit time of ray-box intersection. Uses precomputed reciprocal direction from BVH_Ray for optimal performance. Handles parallel rays (infinite inverse direction) explicitly to avoid NaN from 0*inf when ray origin is exactly on a slab boundary.
 
static bool RayBoxIntersection (const BVH_VecNt &theRayOrigin, const BVH_VecNt &theRayDirection, const BVH_Box< T, N > &theBox, T &theTimeEnter, T &theTimeLeave)
 Computes hit time of ray-box intersection.
 
static bool RayBoxIntersection (const BVH_VecNt &theRayOrigin, const BVH_VecNt &theRayDirection, const BVH_VecNt &theBoxCMin, const BVH_VecNt &theBoxCMax, T &theTimeEnter, T &theTimeLeave)
 Computes hit time of ray-box intersection. Uses optimized single-pass algorithm with early exit.
 

Detailed Description

template<class T, int N>
class BVH_Tools< T, N >

Defines a set of static methods operating with points and bounding boxes.

Template Parameters
TNumeric data type
NVector dimension

Member Typedef Documentation

◆ BVH_VecNt

template<class T , int N>
typedef BVH::VectorType<T,N>::Type BVH_Tools< T, N >::BVH_VecNt

Member Enumeration Documentation

◆ BVH_PrjStateInTriangle

Enumerator
BVH_PrjStateInTriangle_VERTEX 
BVH_PrjStateInTriangle_EDGE 
BVH_PrjStateInTriangle_INNER 

Member Function Documentation

◆ BoxBoxSquareDistance() [1/2]

template<class T , int N>
static T BVH_Tools< T, N >::BoxBoxSquareDistance ( const BVH_Box< T, N > & theBox1,
const BVH_Box< T, N > & theBox2 )
inlinestatic

Computes Square distance between Axis aligned bounding boxes.

◆ BoxBoxSquareDistance() [2/2]

template<class T , int N>
static T BVH_Tools< T, N >::BoxBoxSquareDistance ( const BVH_VecNt & theCMin1,
const BVH_VecNt & theCMax1,
const BVH_VecNt & theCMin2,
const BVH_VecNt & theCMax2 )
inlinestatic

Computes Square distance between Axis aligned bounding boxes.

◆ PointBoxProjection() [1/2]

template<class T , int N>
static BVH_VecNt BVH_Tools< T, N >::PointBoxProjection ( const BVH_VecNt & thePoint,
const BVH_Box< T, N > & theBox )
inlinestatic

Computes projection of point on bounding box.

◆ PointBoxProjection() [2/2]

template<class T , int N>
static BVH_VecNt BVH_Tools< T, N >::PointBoxProjection ( const BVH_VecNt & thePoint,
const BVH_VecNt & theCMin,
const BVH_VecNt & theCMax )
inlinestatic

Computes projection of point on bounding box.

◆ PointBoxSquareDistance() [1/2]

template<class T , int N>
static T BVH_Tools< T, N >::PointBoxSquareDistance ( const BVH_VecNt & thePoint,
const BVH_Box< T, N > & theBox )
inlinestatic

Computes square distance between point and bounding box.

◆ PointBoxSquareDistance() [2/2]

template<class T , int N>
static T BVH_Tools< T, N >::PointBoxSquareDistance ( const BVH_VecNt & thePoint,
const BVH_VecNt & theCMin,
const BVH_VecNt & theCMax )
inlinestatic

Computes square distance between point and bounding box.

◆ PointTriangleProjection()

template<class T , int N>
static BVH_VecNt BVH_Tools< T, N >::PointTriangleProjection ( const BVH_VecNt & thePoint,
const BVH_VecNt & theNode0,
const BVH_VecNt & theNode1,
const BVH_VecNt & theNode2,
BVH_PrjStateInTriangle * thePrjState = nullptr,
int * theNumberOfFirstNode = nullptr,
int * theNumberOfLastNode = nullptr )
inlinestatic

Computes square distance between point and triangle.

◆ PointTriangleSquareDistance()

template<class T , int N>
static T BVH_Tools< T, N >::PointTriangleSquareDistance ( const BVH_VecNt & thePoint,
const BVH_VecNt & theNode0,
const BVH_VecNt & theNode1,
const BVH_VecNt & theNode2 )
inlinestatic

Computes square distance between point and triangle.

◆ RayBoxIntersection() [1/4]

template<class T , int N>
static bool BVH_Tools< T, N >::RayBoxIntersection ( const BVH_Ray< T, N > & theRay,
const BVH_Box< T, N > & theBox,
T & theTimeEnter,
T & theTimeLeave )
inlinestatic

Computes hit time of ray-box intersection. Uses precomputed reciprocal direction from BVH_Ray for optimal performance. Handles parallel rays (infinite inverse direction) explicitly to avoid NaN from 0*inf when ray origin is exactly on a slab boundary.

◆ RayBoxIntersection() [2/4]

template<class T , int N>
static bool BVH_Tools< T, N >::RayBoxIntersection ( const BVH_Ray< T, N > & theRay,
const BVH_VecNt & theBoxCMin,
const BVH_VecNt & theBoxCMax,
T & theTimeEnter,
T & theTimeLeave )
inlinestatic

Computes hit time of ray-box intersection. Uses precomputed reciprocal direction from BVH_Ray for optimal performance. Handles parallel rays (infinite inverse direction) explicitly to avoid NaN from 0*inf when ray origin is exactly on a slab boundary.

◆ RayBoxIntersection() [3/4]

template<class T , int N>
static bool BVH_Tools< T, N >::RayBoxIntersection ( const BVH_VecNt & theRayOrigin,
const BVH_VecNt & theRayDirection,
const BVH_Box< T, N > & theBox,
T & theTimeEnter,
T & theTimeLeave )
inlinestatic

Computes hit time of ray-box intersection.

◆ RayBoxIntersection() [4/4]

template<class T , int N>
static bool BVH_Tools< T, N >::RayBoxIntersection ( const BVH_VecNt & theRayOrigin,
const BVH_VecNt & theRayDirection,
const BVH_VecNt & theBoxCMin,
const BVH_VecNt & theBoxCMax,
T & theTimeEnter,
T & theTimeLeave )
inlinestatic

Computes hit time of ray-box intersection. Uses optimized single-pass algorithm with early exit.

Parameters
theRayOriginray origin point
theRayDirectionray direction vector
theBoxCMinminimum corner of the box
theBoxCMaxmaximum corner of the box
theTimeEntertime of ray entering the box
theTimeLeavetime of ray leaving the box
Returns
true if ray intersects the box

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