lux::Shape Class Reference

#include <shape.h>

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

List of all members.

Public Member Functions

 Shape (const Transform &o2w, bool ro)
 Shape (const Transform &o2w, bool ro, boost::shared_ptr< Material > material)
virtual ~Shape ()
void SetMaterial (boost::shared_ptr< Material > mat)
boost::shared_ptr< MaterialGetMaterial () const
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 *isect) const
virtual void GetShadingGeometry (const Transform &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) const
virtual bool CanSample () const
virtual void Sample (float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual void Sample (const Point &p, float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual BBox ObjectBound () const
virtual void Refine (vector< boost::shared_ptr< Shape > > &refined) const
virtual bool Intersect (const Ray &ray, float *t_hitp, DifferentialGeometry *dg) const
virtual Point Sample (float u1, float u2, float u3, Normal *Ns) const
virtual Point Sample (const Point &p, float u1, float u2, float u3, Normal *Ns) const

Public Attributes

const Transform ObjectToWorld
const Transform WorldToObject
const bool reverseOrientation
const bool transformSwapsHandedness

Protected Attributes

boost::shared_ptr< Materialmaterial

Detailed Description

Definition at line 35 of file shape.h.


Constructor & Destructor Documentation

Shape::Shape ( const Transform o2w,
bool  ro 
)

Definition at line 32 of file shape.cpp.

Shape::Shape ( const Transform o2w,
bool  ro,
boost::shared_ptr< Material material 
)

Definition at line 37 of file shape.cpp.

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

Definition at line 40 of file shape.h.


Member Function Documentation

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

Returns whether this primitive can be intersected.

Implements lux::Primitive.

Reimplemented in lux::Heightfield, lux::LoopSubdiv, lux::Mesh, and lux::NURBS.

Definition at line 65 of file shape.h.

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

Returns whether this primitive can be sampled.

Implements lux::Primitive.

Reimplemented in lux::Mesh.

Definition at line 83 of file shape.h.

boost::shared_ptr<Material> lux::Shape::GetMaterial (  )  const [inline]
virtual void lux::Shape::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 76 of file shape.h.

virtual bool lux::Shape::Intersect ( const Ray ray,
float *  t_hitp,
DifferentialGeometry dg 
) const [inline, virtual]
virtual bool lux::Shape::Intersect ( const Ray r,
Intersection in 
) const [inline, 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 66 of file shape.h.

References lux::DifferentialGeometry::AdjustNormal(), lux::Intersection::dg, lux::Ray::maxt, reverseOrientation, lux::Intersection::Set(), transformSwapsHandedness, and WorldToObject.

virtual BBox lux::Shape::ObjectBound (  )  const [inline, virtual]
virtual void lux::Shape::Refine ( vector< boost::shared_ptr< Shape > > &  refined  )  const [inline, virtual]

Reimplemented in lux::Heightfield, lux::LoopSubdiv, and lux::NURBS.

Definition at line 102 of file shape.h.

References LUX_BUG, LUX_SEVERE, and luxError.

virtual void lux::Shape::Refine ( vector< boost::shared_ptr< Primitive > > &  refined,
const PrimitiveRefinementHints refineHints,
boost::shared_ptr< Primitive thisPtr 
) [inline, 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.

Reimplemented in lux::Mesh.

Definition at line 46 of file shape.h.

virtual Point lux::Shape::Sample ( const Point p,
float  u1,
float  u2,
float  u3,
Normal Ns 
) const [inline, virtual]

Reimplemented in lux::Sphere.

Definition at line 115 of file shape.h.

References Sample().

virtual Point lux::Shape::Sample ( float  u1,
float  u2,
float  u3,
Normal Ns 
) const [inline, virtual]

Reimplemented in lux::Cone, lux::Cylinder, lux::Disk, lux::LensComponent, lux::Quad, lux::Quadrilateral, lux::Sphere, and lux::Torus.

Definition at line 111 of file shape.h.

References LUX_BUG, LUX_SEVERE, and luxError.

virtual void lux::Shape::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 90 of file shape.h.

References lux::CoordinateSystem(), lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdv, lux::DifferentialGeometry::nn, lux::DifferentialGeometry::p, Sample(), lux::DifferentialGeometry::u, and lux::DifferentialGeometry::v.

virtual void lux::Shape::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 84 of file shape.h.

References lux::CoordinateSystem(), lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdv, lux::DifferentialGeometry::nn, lux::DifferentialGeometry::p, lux::DifferentialGeometry::u, and lux::DifferentialGeometry::v.

Referenced by Sample().

void lux::Shape::SetMaterial ( boost::shared_ptr< Material mat  )  [inline]

Definition at line 42 of file shape.h.

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

Returns the world bounds of this primitive.

Implements lux::Primitive.

Reimplemented in lux::LoopSubdiv, lux::Mesh, lux::NURBS, lux::Quad, and lux::Quadrilateral.

Definition at line 45 of file shape.h.

References ObjectBound(), and ObjectToWorld.


Member Data Documentation

boost::shared_ptr<Material> lux::Shape::material [protected]

Definition at line 122 of file shape.h.


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