Blender V4.3
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 37 of file build.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
THREAD_TASK_SIZE 

Definition at line 80 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 35 of file build.cpp.

References spatial_min_overlap.

◆ ~BVHBuild()

BVHBuild::~BVHBuild ( )

Definition at line 55 of file build.cpp.

Member Function Documentation

◆ add_reference_curves()

◆ 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 375 of file build.cpp.

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

Referenced by add_references().

◆ add_reference_points()

◆ add_reference_triangles()

◆ add_references()

◆ 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()

◆ 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 1183 of file build.cpp.

References rotate().

◆ 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 616 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 Symbol Documentation

◆ BVHBuildTask

friend class BVHBuildTask
friend

Definition at line 55 of file build.h.

◆ BVHMixedSplit

friend class BVHMixedSplit
friend

Definition at line 52 of file build.h.

Referenced by build_node().

◆ BVHObjectBinning

friend class BVHObjectBinning
friend

Definition at line 57 of file build.h.

Referenced by build_node().

◆ BVHObjectSplit

friend class BVHObjectSplit
friend

Definition at line 53 of file build.h.

◆ BVHSpatialSplit

friend class BVHSpatialSplit
friend

Definition at line 54 of file build.h.

◆ BVHSpatialSplitBuildTask

friend class BVHSpatialSplitBuildTask
friend

Definition at line 56 of file build.h.

Member Data Documentation

◆ build_mutex

thread_mutex BVHBuild::build_mutex
protected

Definition at line 87 of file build.h.

Referenced by thread_build_node().

◆ need_prim_time

bool BVHBuild::need_prim_time
protected

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

◆ objects

vector<Object *> BVHBuild::objects
protected

Definition at line 97 of file build.h.

Referenced by BVHSpatialSplit::split_reference().

◆ params

◆ prim_index

array<int>& BVHBuild::prim_index
protected

Definition at line 103 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 104 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 105 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 102 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 115 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 117 of file build.h.

Referenced by progress_update(), and run().

◆ progress_start_time

double BVHBuild::progress_start_time
protected

Definition at line 114 of file build.h.

Referenced by progress_update(), and run().

◆ progress_total

size_t BVHBuild::progress_total
protected

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

Referenced by create_leaf_node(), and run().

◆ spatial_min_overlap

float BVHBuild::spatial_min_overlap
protected

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

Referenced by create_leaf_node().

◆ spatial_storage

enumerable_thread_specific<BVHSpatialStorage> BVHBuild::spatial_storage
protected

Definition at line 121 of file build.h.

Referenced by run(), and thread_build_spatial_split_node().

◆ task_pool

TaskPool BVHBuild::task_pool
protected

Definition at line 126 of file build.h.

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

◆ unaligned_heuristic

BVHUnaligned BVHBuild::unaligned_heuristic
protected

Definition at line 129 of file build.h.

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


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