#include <grid.h>
Public Member Functions | |
GridAccel (const vector< Primitive * > &p, bool forRefined, bool refineImmediately) | |
BBox | WorldBound () const |
bool | CanIntersect () const |
~GridAccel () | |
bool | Intersect (const Ray &ray, Intersection *isect) const |
bool | IntersectP (const Ray &ray) const |
Static Public Member Functions | |
static Primitive * | CreateAccelerator (const vector< 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 |
GMailboxPrim * | mailboxes |
int | NVoxels [3] |
BBox | bounds |
Vector | Width |
Vector | InvWidth |
Voxel ** | voxels |
boost::object_pool< Voxel > | voxelArena |
Static Private Attributes | |
static int | curMailboxId = 0 |
Definition at line 90 of file grid.h.
GridAccel::GridAccel | ( | const vector< Primitive * > & | p, | |
bool | forRefined, | |||
bool | refineImmediately | |||
) |
Definition at line 36 of file grid.cpp.
References StatsPercentage::Add(), StatsRatio::Add(), lux::Voxel::AddPrimitive(), lux::AllocAligned(), bounds, Clamp(), lux::Primitive::FullyRefine(), InvWidth, mailboxes, StatsCounter::Max(), lux::BBox::MaximumExtent(), nMailboxes, lux::Voxel::nPrimitives, NVoxels, Offset(), lux::BBox::pMax, lux::BBox::pMin, PosToVoxel(), Round2Int(), lux::Union(), voxelArena, voxels, Width, and WorldBound().
Referenced by CreateAccelerator().
GridAccel::~GridAccel | ( | ) |
Definition at line 124 of file grid.cpp.
References lux::FreeAligned(), mailboxes, nMailboxes, NVoxels, voxels, and lux::Voxel::~Voxel().
bool lux::GridAccel::CanIntersect | ( | ) | const [inline, virtual] |
Reimplemented from lux::Primitive.
Primitive * GridAccel::CreateAccelerator | ( | const vector< Primitive * > & | prims, | |
const ParamSet & | ps | |||
) | [static] |
Definition at line 344 of file grid.cpp.
References lux::ParamSet::FindOneBool(), and GridAccel().
bool GridAccel::Intersect | ( | const Ray & | ray, | |
Intersection * | isect | |||
) | const [virtual] |
Implements lux::Primitive.
Definition at line 134 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 & | ray | ) | const [virtual] |
Implements lux::Primitive.
Definition at line 243 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 116 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 104 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 112 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 109 of file grid.h.
References bounds, lux::BBox::pMin, and Width.
Referenced by Intersect(), and IntersectP().
BBox GridAccel::WorldBound | ( | ) | const [virtual] |
Implements lux::Primitive.
Definition at line 121 of file grid.cpp.
References bounds.
Referenced by GridAccel().
BBox lux::GridAccel::bounds [private] |
Definition at line 124 of file grid.h.
Referenced by GridAccel(), Intersect(), IntersectP(), PosToVoxel(), VoxelToPos(), and WorldBound().
int GridAccel::curMailboxId = 0 [static, private] |
Definition at line 130 of file grid.h.
Referenced by Intersect(), and IntersectP().
bool lux::GridAccel::gridForRefined [private] |
Definition at line 120 of file grid.h.
Referenced by Intersect().
Vector lux::GridAccel::InvWidth [private] |
Definition at line 125 of file grid.h.
Referenced by GridAccel(), and PosToVoxel().
GMailboxPrim* lux::GridAccel::mailboxes [private] |
Definition at line 122 of file grid.h.
Referenced by GridAccel(), and ~GridAccel().
u_int lux::GridAccel::nMailboxes [private] |
Definition at line 121 of file grid.h.
Referenced by GridAccel(), and ~GridAccel().
int lux::GridAccel::NVoxels[3] [private] |
Definition at line 123 of file grid.h.
Referenced by GridAccel(), Intersect(), IntersectP(), Offset(), PosToVoxel(), and ~GridAccel().
boost::object_pool<Voxel> lux::GridAccel::voxelArena [private] |
Definition at line 129 of file grid.h.
Referenced by GridAccel().
Voxel** lux::GridAccel::voxels [private] |
Definition at line 126 of file grid.h.
Referenced by GridAccel(), Intersect(), IntersectP(), and ~GridAccel().
Vector lux::GridAccel::Width [private] |
Definition at line 125 of file grid.h.
Referenced by GridAccel(), Intersect(), IntersectP(), and VoxelToPos().