lux::AreaLightPrimitive Class Reference

#include <primitive.h>

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

List of all members.

Public Member Functions

 AreaLightPrimitive (boost::shared_ptr< Primitive > prim, AreaLight *arealight)
virtual ~AreaLightPrimitive ()
virtual BBox WorldBound () const
virtual void Refine (vector< boost::shared_ptr< Primitive > > &refined, const PrimitiveRefinementHints &refineHints, boost::shared_ptr< Primitive > thisPtr)
virtual bool CanIntersect () const
virtual bool Intersect (const Ray &r, Intersection *in) const
virtual bool IntersectP (const Ray &r) const
virtual void GetShadingGeometry (const Transform &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) const
virtual bool CanSample () const
virtual float Area () const
virtual void Sample (float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual float Pdf (const Point &p) const
virtual void Sample (const Point &P, float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual float Pdf (const Point &p, const Vector &wi) const
virtual float Pdf (const Point &p, const Point &po) const

Private Attributes

boost::shared_ptr< Primitiveprim
AreaLightareaLight

Detailed Description

A decorator for primitives that are light sources. This is achieved by setting the arealight field in the intersection info.

Definition at line 191 of file primitive.h.


Constructor & Destructor Documentation

AreaLightPrimitive::AreaLightPrimitive ( boost::shared_ptr< Primitive prim,
AreaLight arealight 
)

Definition at line 111 of file primitive.cpp.

References areaLight, and prim.

Referenced by Refine().

virtual lux::AreaLightPrimitive::~AreaLightPrimitive (  )  [inline, virtual]

Definition at line 195 of file primitive.h.


Member Function Documentation

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

Returns the area of this primitive.

Reimplemented from lux::Primitive.

Definition at line 212 of file primitive.h.

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

Returns whether this primitive can be intersected.

Implements lux::Primitive.

Definition at line 202 of file primitive.h.

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

Returns whether this primitive can be sampled.

Implements lux::Primitive.

Definition at line 211 of file primitive.h.

virtual void lux::AreaLightPrimitive::GetShadingGeometry ( const Transform obj2world,
const DifferentialGeometry dg,
DifferentialGeometry dgShading 
) const [inline, virtual]

Calculates the shading geometry from the given intersection geometry.

Parameters:
obj2world The object to world transformation to use.
dg The intersection geometry.
dgShading The destination for the shading geometry.

Reimplemented from lux::Primitive.

Definition at line 206 of file primitive.h.

bool AreaLightPrimitive::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 130 of file primitive.cpp.

References areaLight, lux::Intersection::arealight, and prim.

virtual bool lux::AreaLightPrimitive::IntersectP ( const Ray r  )  const [inline, 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 204 of file primitive.h.

virtual float lux::AreaLightPrimitive::Pdf ( const Point p,
const Point po 
) const [inline, virtual]

Returns the probability density for sampling the given point. (

See also:
Primitive::Sample(Point&,float,float,float,Normal*) const). No visibility test is done here.
Parameters:
p The point that was to be tested for visibility with the result.
po The point that was sampled.
Returns:
The pdf value (w.r.t. surface area) for the given point.

Reimplemented from lux::Primitive.

Definition at line 224 of file primitive.h.

virtual float lux::AreaLightPrimitive::Pdf ( const Point p,
const Vector wi 
) const [inline, virtual]

Returns the probability density for sampling the given point. (

See also:
Primitive::Sample(Point&,float,float,float,Normal*) const).
Parameters:
p The point that was to be tested for visibility with the result.
wi The direction from the above point to the sampled point.
Returns:
The pdf value (w.r.t. solid angle) for the given point.

Reimplemented from lux::Primitive.

Definition at line 221 of file primitive.h.

virtual float lux::AreaLightPrimitive::Pdf ( const Point p  )  const [inline, virtual]

Returns the probablity density for sampling the given point (

See also:
Primitive::Sample(float,float,float,Normal*) const).
Parameters:
p The point that was sampled.
Returns:
The pdf value (w.r.t. surface area) for the given point.

Reimplemented from lux::Primitive.

Definition at line 216 of file primitive.h.

void AreaLightPrimitive::Refine ( vector< boost::shared_ptr< Primitive > > &  refined,
const PrimitiveRefinementHints refineHints,
boost::shared_ptr< Primitive thisPtr 
) [virtual]

Refines this primitive to a number of primitives that are intersectable and satisfy all the given hints if possible. If this primitive should not be deallocated after refinement, it must make sure that one of the refined primitives has a shared pointer to this primitive (i.e. a copy of thisPtr)

Parameters:
refined The destenation list for the result.
refineHints The hints for the refinement.
thisPtr The shared pointer to this primitive.

Reimplemented from lux::Primitive.

Definition at line 117 of file primitive.cpp.

References areaLight, AreaLightPrimitive(), and prim.

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

Samples a point on this primitive that will be tested for visibility from a given point. Only the p, nn, dpdu, dpdv, u and v need to be calculated.

Parameters:
p The point that will be tested for visibility with the result.
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 217 of file primitive.h.

virtual void lux::AreaLightPrimitive::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 213 of file primitive.h.

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

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 197 of file primitive.h.


Member Data Documentation

Definition at line 230 of file primitive.h.

Referenced by AreaLightPrimitive(), Intersect(), and Refine().

boost::shared_ptr<Primitive> lux::AreaLightPrimitive::prim [private]

Definition at line 229 of file primitive.h.

Referenced by AreaLightPrimitive(), Intersect(), and Refine().


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