Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
BVH Namespace Reference

Data Structures

struct  Array
 Tool class providing typical operations on the array. More...
 
struct  ArrayType
 Tool class for selecting type of array of vectors. More...
 
struct  BitComparator
 STL compare tool used in binary search algorithm. More...
 
struct  BitPredicate
 
struct  BoundData
 
struct  BoxMinMax
 Tool class for computing component-wise vector minimum and maximum. More...
 
struct  BVH_AxisSelector
 
struct  BVH_AxisSelector< T, 2 >
 
struct  CenterAxis
 Tool class for calculating box center along the given axis. More...
 
struct  MatrixOp
 
struct  MatrixOp< T, 4 >
 
struct  MatrixType
 Tool class for selecting appropriate matrix type (Eigen or NCollection). More...
 
struct  MatrixType< T, 4 >
 
class  RadixSorter
 Tool object for sorting link array using radix sort algorithm. More...
 
struct  SurfaceCalculator
 Tool class for calculating surface area of the box. For N=1, computes length (degenerate case). For N=2, computes area (or perimeter for degenerate boxes). For N>=3, computes 3D surface area using X, Y, Z components only. The W component (4th dimension) is intentionally ignored as BVH surface area heuristic (SAH) operates in 3D geometric space regardless of additional dimensions. More...
 
struct  UnitVector
 
struct  UnitVector< T, 2 >
 
struct  UnitVector< T, 3 >
 
struct  UnitVector< T, 4 >
 
class  UpdateBoundTask
 Task for parallel bounds updating. More...
 
struct  VecComp
 Tool class for accessing specific vector component (by index). More...
 
struct  VecComp< T, 2 >
 
struct  VecComp< T, 3 >
 
struct  VecComp< T, 4 >
 
struct  VectorType
 Tool class for selecting appropriate vector type (Eigen or NCollection). More...
 
struct  VectorType< T, 1 >
 
struct  VectorType< T, 2 >
 
struct  VectorType< T, 3 >
 
struct  VectorType< T, 4 >
 

Functions

template<class T , int N>
int SplitPrimitives (BVH_Set< T, N > *theSet, const BVH_Box< T, N > &theBox, const int theBeg, const int theEnd, const int theBin, const int theAxis, const int theBins)
 
template<class T , int N>
int UpdateBounds (BVH_Set< T, N > *theSet, BVH_Tree< T, N > *theTree, const int theNode=0)
 Calculates bounding boxes (AABBs) for the given BVH tree.
 
constexpr unsigned int EncodeMortonCode (unsigned int theVoxelX, unsigned int theVoxelY, unsigned int theVoxelZ)
 Encodes 10-bit voxel coordinates into 30-bit Morton code using LUT.
 
template<class T , int N>
void EstimateSAH (const BVH_Tree< T, N, BVH_BinaryTree > *theTree, const int theNode, T theProb, T &theSAH)
 Internal function for recursive calculation of surface area heuristic (SAH) of the given tree.
 
template<class T >
Bnd_Box ToBndBox (const T &theMin, const T &theMax)
 
template<class T >
Bnd_Box ToBndBox (const NCollection_Vec2< T > &theMin, const NCollection_Vec2< T > &theMax)
 
template<class T >
Bnd_Box ToBndBox (const NCollection_Vec3< T > &theMin, const NCollection_Vec3< T > &theMax)
 
template<class T >
Bnd_Box ToBndBox (const NCollection_Vec4< T > &theMin, const NCollection_Vec4< T > &theMax)
 

Variables

constexpr double THE_NODE_MIN_SIZE = 1e-5
 Minimum node size to split.
 
constexpr unsigned int THE_MORTON_LUT [256]
 Lookup table for expanding 8-bit value to 24-bit Morton code component. Each bit is spread to every 3rd position for interleaving with other components.
 

Function Documentation

◆ EncodeMortonCode()

constexpr unsigned int BVH::EncodeMortonCode ( unsigned int theVoxelX,
unsigned int theVoxelY,
unsigned int theVoxelZ )
constexpr

Encodes 10-bit voxel coordinates into 30-bit Morton code using LUT.

Parameters
theVoxelXX coordinate (0-1023)
theVoxelYY coordinate (0-1023)
theVoxelZZ coordinate (0-1023)
Returns
30-bit Morton code with interleaved bits

◆ EstimateSAH()

template<class T , int N>
void BVH::EstimateSAH ( const BVH_Tree< T, N, BVH_BinaryTree > * theTree,
const int theNode,
T theProb,
T & theSAH )

Internal function for recursive calculation of surface area heuristic (SAH) of the given tree.

◆ SplitPrimitives()

template<class T , int N>
int BVH::SplitPrimitives ( BVH_Set< T, N > * theSet,
const BVH_Box< T, N > & theBox,
const int theBeg,
const int theEnd,
const int theBin,
const int theAxis,
const int theBins )

◆ ToBndBox() [1/4]

template<class T >
Bnd_Box BVH::ToBndBox ( const NCollection_Vec2< T > & theMin,
const NCollection_Vec2< T > & theMax )

◆ ToBndBox() [2/4]

template<class T >
Bnd_Box BVH::ToBndBox ( const NCollection_Vec3< T > & theMin,
const NCollection_Vec3< T > & theMax )

◆ ToBndBox() [3/4]

template<class T >
Bnd_Box BVH::ToBndBox ( const NCollection_Vec4< T > & theMin,
const NCollection_Vec4< T > & theMax )

◆ ToBndBox() [4/4]

template<class T >
Bnd_Box BVH::ToBndBox ( const T & theMin,
const T & theMax )

◆ UpdateBounds()

template<class T , int N>
int BVH::UpdateBounds ( BVH_Set< T, N > * theSet,
BVH_Tree< T, N > * theTree,
const int theNode = 0 )

Calculates bounding boxes (AABBs) for the given BVH tree.

Variable Documentation

◆ THE_MORTON_LUT

constexpr unsigned int BVH::THE_MORTON_LUT[256]
constexpr
Initial value:
= {
0x000000, 0x000001, 0x000008, 0x000009, 0x000040, 0x000041, 0x000048, 0x000049, 0x000200,
0x000201, 0x000208, 0x000209, 0x000240, 0x000241, 0x000248, 0x000249, 0x001000, 0x001001,
0x001008, 0x001009, 0x001040, 0x001041, 0x001048, 0x001049, 0x001200, 0x001201, 0x001208,
0x001209, 0x001240, 0x001241, 0x001248, 0x001249, 0x008000, 0x008001, 0x008008, 0x008009,
0x008040, 0x008041, 0x008048, 0x008049, 0x008200, 0x008201, 0x008208, 0x008209, 0x008240,
0x008241, 0x008248, 0x008249, 0x009000, 0x009001, 0x009008, 0x009009, 0x009040, 0x009041,
0x009048, 0x009049, 0x009200, 0x009201, 0x009208, 0x009209, 0x009240, 0x009241, 0x009248,
0x009249, 0x040000, 0x040001, 0x040008, 0x040009, 0x040040, 0x040041, 0x040048, 0x040049,
0x040200, 0x040201, 0x040208, 0x040209, 0x040240, 0x040241, 0x040248, 0x040249, 0x041000,
0x041001, 0x041008, 0x041009, 0x041040, 0x041041, 0x041048, 0x041049, 0x041200, 0x041201,
0x041208, 0x041209, 0x041240, 0x041241, 0x041248, 0x041249, 0x048000, 0x048001, 0x048008,
0x048009, 0x048040, 0x048041, 0x048048, 0x048049, 0x048200, 0x048201, 0x048208, 0x048209,
0x048240, 0x048241, 0x048248, 0x048249, 0x049000, 0x049001, 0x049008, 0x049009, 0x049040,
0x049041, 0x049048, 0x049049, 0x049200, 0x049201, 0x049208, 0x049209, 0x049240, 0x049241,
0x049248, 0x049249, 0x200000, 0x200001, 0x200008, 0x200009, 0x200040, 0x200041, 0x200048,
0x200049, 0x200200, 0x200201, 0x200208, 0x200209, 0x200240, 0x200241, 0x200248, 0x200249,
0x201000, 0x201001, 0x201008, 0x201009, 0x201040, 0x201041, 0x201048, 0x201049, 0x201200,
0x201201, 0x201208, 0x201209, 0x201240, 0x201241, 0x201248, 0x201249, 0x208000, 0x208001,
0x208008, 0x208009, 0x208040, 0x208041, 0x208048, 0x208049, 0x208200, 0x208201, 0x208208,
0x208209, 0x208240, 0x208241, 0x208248, 0x208249, 0x209000, 0x209001, 0x209008, 0x209009,
0x209040, 0x209041, 0x209048, 0x209049, 0x209200, 0x209201, 0x209208, 0x209209, 0x209240,
0x209241, 0x209248, 0x209249, 0x240000, 0x240001, 0x240008, 0x240009, 0x240040, 0x240041,
0x240048, 0x240049, 0x240200, 0x240201, 0x240208, 0x240209, 0x240240, 0x240241, 0x240248,
0x240249, 0x241000, 0x241001, 0x241008, 0x241009, 0x241040, 0x241041, 0x241048, 0x241049,
0x241200, 0x241201, 0x241208, 0x241209, 0x241240, 0x241241, 0x241248, 0x241249, 0x248000,
0x248001, 0x248008, 0x248009, 0x248040, 0x248041, 0x248048, 0x248049, 0x248200, 0x248201,
0x248208, 0x248209, 0x248240, 0x248241, 0x248248, 0x248249, 0x249000, 0x249001, 0x249008,
0x249009, 0x249040, 0x249041, 0x249048, 0x249049, 0x249200, 0x249201, 0x249208, 0x249209,
0x249240, 0x249241, 0x249248, 0x249249}

Lookup table for expanding 8-bit value to 24-bit Morton code component. Each bit is spread to every 3rd position for interleaving with other components.

◆ THE_NODE_MIN_SIZE

constexpr double BVH::THE_NODE_MIN_SIZE = 1e-5
constexpr

Minimum node size to split.