lux::PrimitiveSet Class Reference

#include <shape.h>

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

List of all members.

Public Member Functions

 PrimitiveSet (boost::shared_ptr< Aggregate > a)
 PrimitiveSet (const vector< boost::shared_ptr< Primitive > > &p)
virtual ~PrimitiveSet ()
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual bool Intersect (const Ray &r, Intersection *in) const
virtual bool IntersectP (const Ray &r) const
virtual bool CanSample () const
virtual void Sample (float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual float Area () const

Private Member Functions

void initAreas ()

Private Attributes

float area
vector< float > areaCDF
vector< boost::shared_ptr
< Primitive > > 
primitives
BBox worldbound
boost::shared_ptr< Primitiveaccelerator

Detailed Description

Definition at line 125 of file shape.h.


Constructor & Destructor Documentation

PrimitiveSet::PrimitiveSet ( boost::shared_ptr< Aggregate a  ) 

Definition at line 49 of file shape.cpp.

References accelerator, initAreas(), and primitives.

PrimitiveSet::PrimitiveSet ( const vector< boost::shared_ptr< Primitive > > &  p  ) 
virtual lux::PrimitiveSet::~PrimitiveSet (  )  [inline, virtual]

Definition at line 130 of file shape.h.


Member Function Documentation

virtual float lux::PrimitiveSet::Area (  )  const [inline, virtual]

Returns the area of this primitive.

Reimplemented from lux::Primitive.

Definition at line 159 of file shape.h.

References area.

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

Returns whether this primitive can be intersected.

Implements lux::Primitive.

Definition at line 133 of file shape.h.

References primitives.

virtual bool lux::PrimitiveSet::CanSample (  )  const [inline, virtual]

Returns whether this primitive can be sampled.

Implements lux::Primitive.

Definition at line 141 of file shape.h.

References primitives.

void PrimitiveSet::initAreas (  )  [private]

Definition at line 106 of file shape.cpp.

References area, areaCDF, and primitives.

Referenced by PrimitiveSet().

bool PrimitiveSet::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 77 of file shape.cpp.

References accelerator, lux::BBox::IntersectP(), primitives, and worldbound.

bool PrimitiveSet::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 93 of file shape.cpp.

References accelerator, lux::BBox::IntersectP(), primitives, and worldbound.

virtual void lux::PrimitiveSet::Sample ( float  u1,
float  u2,
float  u3,
DifferentialGeometry dg 
) const [inline, virtual]

Samples a point on this primitive. Only the p, nn, dpdu, dpdv, u and v need to be calculated.

Parameters:
u1 The point coordinate in the first dimension.
u2 The point coordinate in the second dimension.
u3 The subprimitive to sample.
dg The destination to store the sampled point in.

Reimplemented from lux::Primitive.

Definition at line 146 of file shape.h.

References areaCDF, Clamp(), and primitives.

virtual BBox lux::PrimitiveSet::WorldBound (  )  const [inline, virtual]

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 132 of file shape.h.

References worldbound.

Referenced by PrimitiveSet().


Member Data Documentation

boost::shared_ptr<Primitive> lux::PrimitiveSet::accelerator [private]

Definition at line 168 of file shape.h.

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

float lux::PrimitiveSet::area [private]

Definition at line 164 of file shape.h.

Referenced by Area(), and initAreas().

vector<float> lux::PrimitiveSet::areaCDF [private]

Definition at line 165 of file shape.h.

Referenced by initAreas(), and Sample().

vector<boost::shared_ptr<Primitive> > lux::PrimitiveSet::primitives [private]

Definition at line 166 of file shape.h.

Referenced by CanIntersect(), CanSample(), initAreas(), Intersect(), IntersectP(), PrimitiveSet(), and Sample().

Definition at line 167 of file shape.h.

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


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