lux::TaBRecKdTreeAccel Class Reference

#include <tabreckdtreeaccel.h>

Inheritance diagram for lux::TaBRecKdTreeAccel:
[legend]
Collaboration diagram for lux::TaBRecKdTreeAccel:
[legend]

List of all members.

Public Member Functions

 TaBRecKdTreeAccel (const vector< boost::shared_ptr< Primitive > > &p, int icost, int scost, float ebonus, int maxp, int maxDepth)
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual ~TaBRecKdTreeAccel ()
virtual bool Intersect (const Ray &ray, Intersection *isect) const
virtual bool IntersectP (const Ray &ray) const
virtual void GetPrimitives (vector< boost::shared_ptr< Primitive > > &prims)

Static Public Member Functions

static AggregateCreateAccelerator (const vector< boost::shared_ptr< Primitive > > &prims, const ParamSet &ps)

Private Member Functions

void buildTree (int nodeNum, const BBox &bounds, const vector< BBox > &primBounds, int *primNums, int nprims, int depth, TaBRecBoundEdge *edges[3], int *prims0, int *prims1, int badRefines=0)

Private Attributes

BBox bounds
int isectCost
int traversalCost
int maxPrims
float emptyBonus
u_int nPrims
boost::shared_ptr< Primitive > * prims
TaBRecKdAccelNodenodes
int nAllocedNodes
int nextFreeNode
MemoryArena arena

Detailed Description

Definition at line 141 of file tabreckdtreeaccel.h.


Constructor & Destructor Documentation

TaBRecKdTreeAccel::TaBRecKdTreeAccel ( const vector< boost::shared_ptr< Primitive > > &  p,
int  icost,
int  scost,
float  ebonus,
int  maxp,
int  maxDepth 
)
TaBRecKdTreeAccel::~TaBRecKdTreeAccel (  )  [virtual]

Definition at line 99 of file tabreckdtree.cpp.

References lux::FreeAligned(), nodes, nPrims, and prims.


Member Function Documentation

void TaBRecKdTreeAccel::buildTree ( int  nodeNum,
const BBox bounds,
const vector< BBox > &  primBounds,
int primNums,
int  nprims,
int  depth,
TaBRecBoundEdge edges[3],
int prims0,
int prims1,
int  badRefines = 0 
) [private]
virtual bool lux::TaBRecKdTreeAccel::CanIntersect (  )  const [inline, virtual]

Returns whether this primitive can be intersected.

Reimplemented from lux::Aggregate.

Definition at line 148 of file tabreckdtreeaccel.h.

Referenced by TaBRecKdTreeAccel().

Aggregate * TaBRecKdTreeAccel::CreateAccelerator ( const vector< boost::shared_ptr< Primitive > > &  prims,
const ParamSet ps 
) [static]
void TaBRecKdTreeAccel::GetPrimitives ( vector< boost::shared_ptr< Primitive > > &  prims  )  [virtual]

Gives all primitives in this aggregate.

Parameters:
prims The destination list for the primitives.

Implements lux::Aggregate.

Definition at line 486 of file tabreckdtree.cpp.

References nPrims, and prims.

bool TaBRecKdTreeAccel::Intersect ( const Ray r,
Intersection in 
) const [virtual]

Intersects this primitive with the given ray. If an intersection is found, the ray will (i.e. r.tmax) and all fields in the intersection info will be updated.

Parameters:
r The ray to intersect with this primitive.
in The destination of the intersection information.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 224 of file tabreckdtree.cpp.

References lux::TaBRecKdAccelNode::aboveChild, bounds, lux::Ray::d, lux::Primitive::Intersect(), lux::BBox::IntersectP(), lux::TaBRecKdAccelNode::IsLeaf(), KDTREE_EPSILON, cimg_library::cimg::max(), MAX_TODO, lux::Ray::maxt, cimg_library::cimg::min(), lux::Ray::mint, lux::TaBRecKdNodeStack::node, nodes, lux::TaBRecKdAccelNode::nPrimitives(), lux::Ray::o, lux::TaBRecKdAccelNode::onePrimitive, lux::TaBRecKdNodeStack::pb, lux::TaBRecKdNodeStack::prev, lux::TaBRecKdAccelNode::primitives, lux::TaBRecKdAccelNode::SplitAxis(), lux::TaBRecKdAccelNode::SplitPos(), lux::TaBRecKdNodeStack::t, lux::Vector::x, lux::Vector::y, and lux::Vector::z.

bool TaBRecKdTreeAccel::IntersectP ( const Ray r  )  const [virtual]
virtual BBox lux::TaBRecKdTreeAccel::WorldBound (  )  const [inline, virtual]

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 147 of file tabreckdtreeaccel.h.

References bounds.


Member Data Documentation

Definition at line 173 of file tabreckdtreeaccel.h.

Referenced by buildTree().

Definition at line 164 of file tabreckdtreeaccel.h.

Referenced by Intersect(), IntersectP(), TaBRecKdTreeAccel(), and WorldBound().

Definition at line 166 of file tabreckdtreeaccel.h.

Referenced by buildTree(), and CreateAccelerator().

Definition at line 165 of file tabreckdtreeaccel.h.

Referenced by buildTree(), and CreateAccelerator().

Definition at line 165 of file tabreckdtreeaccel.h.

Referenced by buildTree(), and CreateAccelerator().

Definition at line 171 of file tabreckdtreeaccel.h.

Referenced by buildTree(), and TaBRecKdTreeAccel().

Definition at line 171 of file tabreckdtreeaccel.h.

Referenced by buildTree(), and TaBRecKdTreeAccel().

Definition at line 170 of file tabreckdtreeaccel.h.

Referenced by buildTree(), Intersect(), IntersectP(), and ~TaBRecKdTreeAccel().

Definition at line 168 of file tabreckdtreeaccel.h.

Referenced by GetPrimitives(), TaBRecKdTreeAccel(), and ~TaBRecKdTreeAccel().

boost::shared_ptr<Primitive>* lux::TaBRecKdTreeAccel::prims [private]

Definition at line 165 of file tabreckdtreeaccel.h.

Referenced by buildTree().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208