Blender V5.0
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 ()
unique_ptr< BVHNoderun ()

Protected Types

enum  { THREAD_TASK_SIZE = 4096 }

Protected Member Functions

void add_reference_triangles (BoundBox &root, BoundBox &center, Mesh *mesh, const int object_index)
void add_reference_curves (BoundBox &root, BoundBox &center, Hair *hair, const int object_index)
void add_reference_points (BoundBox &root, BoundBox &center, PointCloud *pointcloud, const int i)
void add_reference_geometry (BoundBox &root, BoundBox &center, Geometry *geom, const int object_index)
void add_reference_object (BoundBox &root, BoundBox &center, Object *ob, const int i)
void add_references (BVHRange &root)
unique_ptr< BVHNodebuild_node (const BVHRange &range, vector< BVHReference > &references, const int level, BVHSpatialStorage *storage)
unique_ptr< BVHNodebuild_node (const BVHObjectBinning &range, const int level)
unique_ptr< BVHNodecreate_leaf_node (const BVHRange &range, const vector< BVHReference > &references)
unique_ptr< BVHNodecreate_object_leaf_nodes (const BVHReference *ref, const int start, const int num)
bool range_within_max_leaf_size (const BVHRange &range, const vector< BVHReference > &references) const
void thread_build_node (InnerNode *inner, const int child, const BVHObjectBinning &range, const int level)
void thread_build_spatial_split_node (InnerNode *inner, const int child, const BVHRange &range, vector< BVHReference > &references, int level)
void progress_update ()
void rotate (BVHNode *node, const int max_depth)
void rotate (BVHNode *node, const int max_depth, const 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 37 of file build.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
THREAD_TASK_SIZE 

Definition at line 89 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 )

◆ ~BVHBuild()

BVHBuild::~BVHBuild ( )
default

Member Function Documentation

◆ add_reference_curves()

◆ add_reference_geometry()

void BVHBuild::add_reference_geometry ( BoundBox & root,
BoundBox & center,
Geometry * geom,
const int object_index )
protected

◆ add_reference_object()

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

Definition at line 376 of file build.cpp.

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

Referenced by add_references().

◆ add_reference_points()

◆ add_reference_triangles()

◆ add_references()

void BVHBuild::add_references ( BVHRange & root)
protected

◆ build_node() [1/2]

◆ build_node() [2/2]

◆ create_leaf_node()

◆ create_object_leaf_nodes()

◆ 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,
const int max_depth )
protected

◆ rotate() [2/2]

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

Definition at line 1226 of file build.cpp.

References i, and rotate().

◆ run()

◆ thread_build_node()

void BVHBuild::thread_build_node ( InnerNode * inner,
const int child,
const BVHObjectBinning & range,
const int level )
protected

◆ thread_build_spatial_split_node()

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

Definition at line 636 of file build.cpp.

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

Referenced by build_node().

◆ BVHBuildTask

friend class BVHBuildTask
friend

Definition at line 55 of file build.h.

References BVHBuildTask.

Referenced by BVHBuildTask.

◆ BVHMixedSplit

friend class BVHMixedSplit
friend

Definition at line 52 of file build.h.

References BVHMixedSplit.

Referenced by build_node(), and BVHMixedSplit.

◆ BVHObjectBinning

friend class BVHObjectBinning
friend

Definition at line 57 of file build.h.

References BVHObjectBinning, i, num, and references.

Referenced by build_node(), BVHObjectBinning, run(), and thread_build_node().

◆ BVHObjectSplit

friend class BVHObjectSplit
friend

Definition at line 53 of file build.h.

References BVHObjectSplit.

Referenced by BVHObjectSplit.

◆ BVHSpatialSplit

friend class BVHSpatialSplit
friend

Definition at line 54 of file build.h.

References BVHSpatialSplit.

Referenced by BVHSpatialSplit.

◆ BVHSpatialSplitBuildTask

friend class BVHSpatialSplitBuildTask
friend

Definition at line 56 of file build.h.

References BVHSpatialSplitBuildTask.

Referenced by BVHSpatialSplitBuildTask.

Member Data Documentation

◆ build_mutex

thread_mutex BVHBuild::build_mutex
protected

Definition at line 99 of file build.h.

Referenced by thread_build_node().

◆ need_prim_time

bool BVHBuild::need_prim_time
protected

Definition at line 119 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 111 of file build.h.

◆ objects

vector<Object *> BVHBuild::objects
protected

◆ params

◆ prim_index

array<int>& BVHBuild::prim_index
protected

Definition at line 115 of file build.h.

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

◆ prim_object

array<int>& BVHBuild::prim_object
protected

Definition at line 116 of file build.h.

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

◆ prim_time

array<float2>& BVHBuild::prim_time
protected

Definition at line 117 of file build.h.

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

◆ prim_type

array<int>& BVHBuild::prim_type
protected

Definition at line 114 of file build.h.

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

◆ progress

◆ progress_count

size_t BVHBuild::progress_count
protected

Definition at line 127 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 129 of file build.h.

Referenced by progress_update(), and run().

◆ progress_start_time

double BVHBuild::progress_start_time
protected

Definition at line 126 of file build.h.

Referenced by BVHBuild(), progress_update(), and run().

◆ progress_total

size_t BVHBuild::progress_total
protected

Definition at line 128 of file build.h.

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

◆ references

◆ spatial_free_index

size_t BVHBuild::spatial_free_index
protected

Definition at line 134 of file build.h.

Referenced by create_leaf_node(), and run().

◆ spatial_min_overlap

float BVHBuild::spatial_min_overlap
protected

Definition at line 132 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 135 of file build.h.

Referenced by create_leaf_node().

◆ spatial_storage

enumerable_thread_specific<BVHSpatialStorage> BVHBuild::spatial_storage
protected

Definition at line 133 of file build.h.

Referenced by run(), and thread_build_spatial_split_node().

◆ task_pool

TaskPool BVHBuild::task_pool
protected

Definition at line 138 of file build.h.

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

◆ unaligned_heuristic

BVHUnaligned BVHBuild::unaligned_heuristic
protected

Definition at line 141 of file build.h.

Referenced by build_node(), build_node(), BVHBuild(), and create_leaf_node().


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