Blender  V3.3
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
BVHBuild Class Reference

#include <build.h>

Public Member Functions

 BVHBuild (const vector< Object * > &objects, array< int > &prim_type, array< int > &prim_index, array< int > &prim_object, array< float2 > &prim_time, const BVHParams &params, Progress &progress)
 
 ~BVHBuild ()
 
BVHNoderun ()
 

Protected Types

enum  { THREAD_TASK_SIZE = 4096 }
 

Protected Member Functions

void add_reference_triangles (BoundBox &root, BoundBox &center, Mesh *mesh, int i)
 
void add_reference_curves (BoundBox &root, BoundBox &center, Hair *hair, int i)
 
void add_reference_points (BoundBox &root, BoundBox &center, PointCloud *pointcloud, int i)
 
void add_reference_geometry (BoundBox &root, BoundBox &center, Geometry *geom, int i)
 
void add_reference_object (BoundBox &root, BoundBox &center, Object *ob, int i)
 
void add_references (BVHRange &root)
 
BVHNodebuild_node (const BVHRange &range, vector< BVHReference > &references, int level, BVHSpatialStorage *storage)
 
BVHNodebuild_node (const BVHObjectBinning &range, int level)
 
BVHNodecreate_leaf_node (const BVHRange &range, const vector< BVHReference > &references)
 
BVHNodecreate_object_leaf_nodes (const BVHReference *ref, int start, int num)
 
bool range_within_max_leaf_size (const BVHRange &range, const vector< BVHReference > &references) const
 
void thread_build_node (InnerNode *node, int child, const BVHObjectBinning &range, int level)
 
void thread_build_spatial_split_node (InnerNode *node, int child, const BVHRange &range, vector< BVHReference > &references, int level)
 
void progress_update ()
 
void rotate (BVHNode *node, int max_depth)
 
void rotate (BVHNode *node, int max_depth, int iterations)
 

Protected Attributes

thread_mutex build_mutex
 
vector< Object * > objects
 
vector< BVHReferencereferences
 
int num_original_references
 
array< int > & prim_type
 
array< int > & prim_index
 
array< int > & prim_object
 
array< float2 > & prim_time
 
bool need_prim_time
 
BVHParams params
 
Progressprogress
 
double progress_start_time
 
size_t progress_count
 
size_t progress_total
 
size_t progress_original_total
 
float spatial_min_overlap
 
enumerable_thread_specific< BVHSpatialStoragespatial_storage
 
size_t spatial_free_index
 
thread_spin_lock spatial_spin_lock
 
TaskPool task_pool
 
BVHUnaligned unaligned_heuristic
 

Friends

class BVHMixedSplit
 
class BVHObjectSplit
 
class BVHSpatialSplit
 
class BVHBuildTask
 
class BVHSpatialSplitBuildTask
 
class BVHObjectBinning
 

Detailed Description

Definition at line 34 of file build.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
THREAD_TASK_SIZE 

Definition at line 77 of file build.h.

Constructor & Destructor Documentation

◆ BVHBuild()

CCL_NAMESPACE_BEGIN BVHBuild::BVHBuild ( const vector< Object * > &  objects,
array< int > &  prim_type,
array< int > &  prim_index,
array< int > &  prim_object,
array< float2 > &  prim_time,
const BVHParams params,
Progress progress 
)

Definition at line 32 of file build.cpp.

References spatial_min_overlap.

◆ ~BVHBuild()

BVHBuild::~BVHBuild ( )

Definition at line 52 of file build.cpp.

Member Function Documentation

◆ add_reference_curves()

void BVHBuild::add_reference_curves ( BoundBox root,
BoundBox center,
Hair hair,
int  i 
)
protected

◆ add_reference_geometry()

void BVHBuild::add_reference_geometry ( BoundBox root,
BoundBox center,
Geometry geom,
int  i 
)
protected

◆ add_reference_object()

void BVHBuild::add_reference_object ( BoundBox root,
BoundBox center,
Object ob,
int  i 
)
protected

Definition at line 374 of file build.cpp.

References Object::bounds, center, BoundBox::center2(), BoundBox::grow(), and references.

Referenced by add_references().

◆ add_reference_points()

void BVHBuild::add_reference_points ( BoundBox root,
BoundBox center,
PointCloud pointcloud,
int  i 
)
protected

◆ add_reference_triangles()

void BVHBuild::add_reference_triangles ( BoundBox root,
BoundBox center,
Mesh mesh,
int  i 
)
protected

◆ add_references()

void BVHBuild::add_references ( BVHRange root)
protected

◆ build_node() [1/2]

BVHNode * BVHBuild::build_node ( const BVHObjectBinning range,
int  level 
)
protected

◆ build_node() [2/2]

BVHNode * BVHBuild::build_node ( const BVHRange range,
vector< BVHReference > &  references,
int  level,
BVHSpatialStorage storage 
)
protected

◆ create_leaf_node()

BVHNode * BVHBuild::create_leaf_node ( const BVHRange range,
const vector< BVHReference > &  references 
)
protected

◆ create_object_leaf_nodes()

BVHNode * BVHBuild::create_object_leaf_nodes ( const BVHReference ref,
int  start,
int  num 
)
protected

◆ progress_update()

void BVHBuild::progress_update ( )
protected

◆ range_within_max_leaf_size()

bool BVHBuild::range_within_max_leaf_size ( const BVHRange range,
const vector< BVHReference > &  references 
) const
protected

◆ rotate() [1/2]

void BVHBuild::rotate ( BVHNode node,
int  max_depth 
)
protected

◆ rotate() [2/2]

void BVHBuild::rotate ( BVHNode node,
int  max_depth,
int  iterations 
)
protected

Definition at line 1170 of file build.cpp.

References node, and rotate().

◆ run()

BVHNode * BVHBuild::run ( )

◆ thread_build_node()

void BVHBuild::thread_build_node ( InnerNode node,
int  child,
const BVHObjectBinning range,
int  level 
)
protected

◆ thread_build_spatial_split_node()

void BVHBuild::thread_build_spatial_split_node ( InnerNode node,
int  child,
const BVHRange range,
vector< BVHReference > &  references,
int  level 
)
protected

Definition at line 606 of file build.cpp.

References build_node(), InnerNode::children, Progress::get_cancel(), node, progress, references, and spatial_storage.

Referenced by build_node().

Friends And Related Function Documentation

◆ BVHBuildTask

friend class BVHBuildTask
friend

Definition at line 52 of file build.h.

◆ BVHMixedSplit

friend class BVHMixedSplit
friend

Definition at line 49 of file build.h.

Referenced by build_node().

◆ BVHObjectBinning

friend class BVHObjectBinning
friend

Definition at line 54 of file build.h.

Referenced by build_node().

◆ BVHObjectSplit

friend class BVHObjectSplit
friend

Definition at line 50 of file build.h.

◆ BVHSpatialSplit

friend class BVHSpatialSplit
friend

Definition at line 51 of file build.h.

◆ BVHSpatialSplitBuildTask

friend class BVHSpatialSplitBuildTask
friend

Definition at line 53 of file build.h.

Member Data Documentation

◆ build_mutex

thread_mutex BVHBuild::build_mutex
protected

Definition at line 84 of file build.h.

Referenced by thread_build_node().

◆ need_prim_time

bool BVHBuild::need_prim_time
protected

Definition at line 104 of file build.h.

Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().

◆ num_original_references

int BVHBuild::num_original_references
protected

Definition at line 96 of file build.h.

◆ objects

vector<Object *> BVHBuild::objects
protected

◆ params

BVHParams BVHBuild::params
protected

◆ prim_index

array<int>& BVHBuild::prim_index
protected

Definition at line 100 of file build.h.

Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().

◆ prim_object

array<int>& BVHBuild::prim_object
protected

Definition at line 101 of file build.h.

Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().

◆ prim_time

array<float2>& BVHBuild::prim_time
protected

Definition at line 102 of file build.h.

Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().

◆ prim_type

array<int>& BVHBuild::prim_type
protected

Definition at line 99 of file build.h.

Referenced by create_leaf_node(), create_object_leaf_nodes(), and run().

◆ progress

Progress& BVHBuild::progress
protected

◆ progress_count

size_t BVHBuild::progress_count
protected

Definition at line 112 of file build.h.

Referenced by build_node(), create_leaf_node(), progress_update(), run(), and thread_build_node().

◆ progress_original_total

size_t BVHBuild::progress_original_total
protected

Definition at line 114 of file build.h.

Referenced by progress_update(), and run().

◆ progress_start_time

double BVHBuild::progress_start_time
protected

Definition at line 111 of file build.h.

Referenced by progress_update(), and run().

◆ progress_total

size_t BVHBuild::progress_total
protected

Definition at line 113 of file build.h.

Referenced by build_node(), create_leaf_node(), progress_update(), and run().

◆ references

vector<BVHReference> BVHBuild::references
protected

◆ spatial_free_index

size_t BVHBuild::spatial_free_index
protected

Definition at line 119 of file build.h.

Referenced by create_leaf_node(), and run().

◆ spatial_min_overlap

float BVHBuild::spatial_min_overlap
protected

Definition at line 117 of file build.h.

Referenced by BVHBuild(), BVHMixedSplit::BVHMixedSplit(), and run().

◆ spatial_spin_lock

thread_spin_lock BVHBuild::spatial_spin_lock
protected

Definition at line 120 of file build.h.

Referenced by create_leaf_node().

◆ spatial_storage

enumerable_thread_specific<BVHSpatialStorage> BVHBuild::spatial_storage
protected

Definition at line 118 of file build.h.

Referenced by run(), and thread_build_spatial_split_node().

◆ task_pool

TaskPool BVHBuild::task_pool
protected

Definition at line 123 of file build.h.

Referenced by build_node(), and run().

◆ unaligned_heuristic

BVHUnaligned BVHBuild::unaligned_heuristic
protected

Definition at line 126 of file build.h.

Referenced by build_node(), and create_leaf_node().


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