lux::UnsafeKdTreeAccel Class Reference

#include <unsafekdtreeaccel.h>

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

List of all members.

Public Member Functions

 UnsafeKdTreeAccel (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 ~UnsafeKdTreeAccel ()
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, UnsafeBoundEdge *edges[3], int *prims0, int *prims1, int badRefines=0)

Private Attributes

BBox bounds
int isectCost
int traversalCost
int maxPrims
float emptyBonus
u_int nMailboxes
MailboxPrimmailboxPrims
int curMailboxId
UnsafeKdAccelNodenodes
int nAllocedNodes
int nextFreeNode
MemoryArena arena

Detailed Description

Definition at line 118 of file unsafekdtreeaccel.h.


Constructor & Destructor Documentation

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

Definition at line 86 of file unsafekdtree.cpp.

References lux::FreeAligned(), mailboxPrims, nMailboxes, and nodes.


Member Function Documentation

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

Returns whether this primitive can be intersected.

Reimplemented from lux::Aggregate.

Definition at line 125 of file unsafekdtreeaccel.h.

Referenced by UnsafeKdTreeAccel().

Aggregate * UnsafeKdTreeAccel::CreateAccelerator ( const vector< boost::shared_ptr< Primitive > > &  prims,
const ParamSet ps 
) [static]
void UnsafeKdTreeAccel::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 393 of file unsafekdtree.cpp.

References mailboxPrims, and nMailboxes.

bool UnsafeKdTreeAccel::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 209 of file unsafekdtree.cpp.

References lux::UnsafeKdAccelNode::aboveChild, bounds, curMailboxId, lux::Ray::d, lux::BBox::IntersectP(), lux::UnsafeKdAccelNode::IsLeaf(), lux::MailboxPrim::lastMailboxId, MAX_TODO, lux::Ray::maxt, lux::KdToDo::node, nodes, lux::UnsafeKdAccelNode::nPrimitives(), lux::Ray::o, lux::UnsafeKdAccelNode::onePrimitive, lux::MailboxPrim::primitive, lux::UnsafeKdAccelNode::primitives, lux::UnsafeKdAccelNode::SplitAxis(), lux::UnsafeKdAccelNode::SplitPos(), lux::KdToDo::tmax, lux::KdToDo::tmin, lux::Vector::x, lux::Vector::y, and lux::Vector::z.

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

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 124 of file unsafekdtreeaccel.h.

References bounds.


Member Data Documentation

Definition at line 150 of file unsafekdtreeaccel.h.

Referenced by buildTree().

Definition at line 141 of file unsafekdtreeaccel.h.

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

Definition at line 146 of file unsafekdtreeaccel.h.

Referenced by Intersect(), IntersectP(), and UnsafeKdTreeAccel().

Definition at line 143 of file unsafekdtreeaccel.h.

Referenced by buildTree(), and CreateAccelerator().

Definition at line 142 of file unsafekdtreeaccel.h.

Referenced by buildTree(), and CreateAccelerator().

Definition at line 142 of file unsafekdtreeaccel.h.

Referenced by buildTree(), and CreateAccelerator().

Definition at line 148 of file unsafekdtreeaccel.h.

Referenced by buildTree(), and UnsafeKdTreeAccel().

Definition at line 148 of file unsafekdtreeaccel.h.

Referenced by buildTree(), and UnsafeKdTreeAccel().

Definition at line 144 of file unsafekdtreeaccel.h.

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

Definition at line 147 of file unsafekdtreeaccel.h.

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

Definition at line 142 of file unsafekdtreeaccel.h.

Referenced by buildTree().


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