lux::GridAccel Class Reference

#include <grid.h>

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

List of all members.

Public Member Functions

 GridAccel (const vector< boost::shared_ptr< Primitive > > &p, bool forRefined, bool refineImmediately)
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual ~GridAccel ()
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

int PosToVoxel (const Point &P, int axis) const
float VoxelToPos (int p, int axis) const
Point VoxelToPos (int x, int y, int z) const
int Offset (int x, int y, int z) const

Private Attributes

bool gridForRefined
u_int nMailboxes
GMailboxPrimmailboxes
int NVoxels [3]
BBox bounds
Vector Width
Vector InvWidth
Voxel ** voxels
boost::object_pool< VoxelvoxelArena

Static Private Attributes

static int curMailboxId = 0

Detailed Description

Definition at line 89 of file grid.h.


Constructor & Destructor Documentation

GridAccel::GridAccel ( const vector< boost::shared_ptr< Primitive > > &  p,
bool  forRefined,
bool  refineImmediately 
)
GridAccel::~GridAccel (  )  [virtual]

Definition at line 129 of file grid.cpp.

References lux::FreeAligned(), mailboxes, nMailboxes, NVoxels, voxels, and lux::Voxel::~Voxel().


Member Function Documentation

virtual bool lux::GridAccel::CanIntersect (  )  const [inline, virtual]

Returns whether this primitive can be intersected.

Reimplemented from lux::Aggregate.

Definition at line 95 of file grid.h.

Referenced by GridAccel().

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

Definition at line 357 of file grid.cpp.

References lux::ParamSet::FindOneBool(), and GridAccel().

void GridAccel::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 351 of file grid.cpp.

References mailboxes, and nMailboxes.

bool GridAccel::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 139 of file grid.cpp.

References bounds, curMailboxId, lux::Ray::d, gridForRefined, if(), lux::BBox::Inside(), lux::Voxel::Intersect(), lux::BBox::IntersectP(), lux::Ray::maxt, lux::Ray::mint, NVoxels, Offset(), PosToVoxel(), voxels, VoxelToPos(), and Width.

bool GridAccel::IntersectP ( const Ray r  )  const [virtual]

Tests for intersection of this primitive with the given ray.

Parameters:
r The ray to intersect with this primitive.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 249 of file grid.cpp.

References bounds, curMailboxId, lux::Ray::d, if(), lux::BBox::Inside(), lux::Voxel::IntersectP(), lux::BBox::IntersectP(), lux::Ray::maxt, lux::Ray::mint, NVoxels, Offset(), PosToVoxel(), voxels, VoxelToPos(), and Width.

int lux::GridAccel::Offset ( int  x,
int  y,
int  z 
) const [inline, private]

Definition at line 117 of file grid.h.

References NVoxels.

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

int lux::GridAccel::PosToVoxel ( const Point P,
int  axis 
) const [inline, private]

Definition at line 105 of file grid.h.

References bounds, Clamp(), Float2Int(), InvWidth, NVoxels, and lux::BBox::pMin.

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

Point lux::GridAccel::VoxelToPos ( int  x,
int  y,
int  z 
) const [inline, private]

Definition at line 113 of file grid.h.

References bounds, lux::BBox::pMin, and Width.

float lux::GridAccel::VoxelToPos ( int  p,
int  axis 
) const [inline, private]

Definition at line 110 of file grid.h.

References bounds, lux::BBox::pMin, and Width.

Referenced by Intersect(), and IntersectP().

BBox GridAccel::WorldBound (  )  const [virtual]

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 126 of file grid.cpp.

References bounds.

Referenced by GridAccel().


Member Data Documentation

Definition at line 125 of file grid.h.

Referenced by GridAccel(), Intersect(), IntersectP(), PosToVoxel(), VoxelToPos(), and WorldBound().

int GridAccel::curMailboxId = 0 [static, private]

Definition at line 131 of file grid.h.

Referenced by Intersect(), and IntersectP().

Definition at line 121 of file grid.h.

Referenced by Intersect().

Definition at line 126 of file grid.h.

Referenced by GridAccel(), and PosToVoxel().

Definition at line 123 of file grid.h.

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

Definition at line 122 of file grid.h.

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

Definition at line 124 of file grid.h.

Referenced by GridAccel(), Intersect(), IntersectP(), Offset(), PosToVoxel(), and ~GridAccel().

boost::object_pool<Voxel> lux::GridAccel::voxelArena [private]

Definition at line 130 of file grid.h.

Referenced by GridAccel().

Definition at line 127 of file grid.h.

Referenced by GridAccel(), Intersect(), IntersectP(), and ~GridAccel().

Definition at line 126 of file grid.h.

Referenced by GridAccel(), Intersect(), IntersectP(), and VoxelToPos().


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