ShapeSet Class Reference

Represents a collection of shapes which all have the same transformation. More...

#include <ShapeSet.h>

Inheritance diagram for ShapeSet:

Transformable PropertyMap Shape Intersectable SSEAligned

List of all members.

Public Member Functions

Constructors
 ShapeSet (bool ownMemory=true)
 ShapeSet (const PrimitiveList &primitiveList, bool ownMemory=true)
virtual ~ShapeSet ()
Core functionality
virtual void init (bool initChildren)
virtual void init ()
 Initializes this Transformable's world-space AABB, assuming a derived class has already filled in m_objSpaceAABB.
virtual void preview ()
virtual real_t getIntersection (const Ray &ray, SurfacePoint &pt)
 Tests the given ray with this object for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this object to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).
virtual bool intersects (const Ray &ray, real_t tMax=INFINITY)
 Used for occlusion/visibility testing where you don't necessarily care about anything other than whether or not an intersection exists. (generally faster than getIntersection).
Accessors / Mutators
unsigned size () const
Shapeoperator[] (unsigned int index)
void push_back (Shape *shape)
void clear ()
PrimitiveList & getPrimitives ()

Protected Member Functions

virtual void _getUV (SurfacePoint &pt) const
virtual void _getGeometricNormal (SurfacePoint &pt) const
virtual real_t _getSurfaceArea ()

Protected Attributes

PrimitiveList m_primitives
SpatialAccelm_spatialAccel
bool m_ownMemory


Detailed Description

Represents a collection of shapes which all have the same transformation.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 19 of file ShapeSet.h.


Constructor & Destructor Documentation

ShapeSet::ShapeSet ( bool  ownMemory = true  )  [inline]

Definition at line 24 of file ShapeSet.h.

ShapeSet::ShapeSet ( const PrimitiveList &  primitiveList,
bool  ownMemory = true 
) [inline]

Definition at line 30 of file ShapeSet.h.

ShapeSet::~ShapeSet (  )  [virtual]

Definition at line 18 of file ShapeSet.cpp.


Member Function Documentation

void ShapeSet::init ( bool  initChildren  )  [virtual]

Definition at line 35 of file ShapeSet.cpp.

void ShapeSet::init (  )  [virtual]

Initializes this Transformable's world-space AABB, assuming a derived class has already filled in m_objSpaceAABB.

Reimplemented from Transformable.

Definition at line 31 of file ShapeSet.cpp.

void ShapeSet::preview (  )  [virtual]

Display a crude OpenGL preview of this shape

Note:
Default implementation sets the ModelView matrix appropriately with respect to this Transformable's transformation

Reimplemented from Transformable.

Definition at line 81 of file ShapeSet.cpp.

real_t ShapeSet::getIntersection ( const Ray ray,
SurfacePoint pt 
) [virtual]

Tests the given ray with this object for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this object to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).

Note:
if you only care about whether or not an intersection exists and don't actually need to know the exact intersection point, see the intersects method instead.
Returns:
the smallest positive "t" value of any intersections found, or INFINITY if no valid intersection exists

Implements Intersectable.

Definition at line 101 of file ShapeSet.cpp.

bool ShapeSet::intersects ( const Ray ray,
real_t  tMax = INFINITY 
) [virtual]

Used for occlusion/visibility testing where you don't necessarily care about anything other than whether or not an intersection exists. (generally faster than getIntersection).

Note:
default implementation defers to getIntersection
Returns:
whether or not the given ray intersects this object with a positive "t" value greater than EPSILON and less than the given tMax

Reimplemented from Intersectable.

Definition at line 112 of file ShapeSet.cpp.

unsigned ShapeSet::size (  )  const [inline]

Definition at line 58 of file ShapeSet.h.

Shape* ShapeSet::operator[] ( unsigned int  index  )  [inline]

Definition at line 62 of file ShapeSet.h.

void ShapeSet::push_back ( Shape shape  )  [inline]

Definition at line 68 of file ShapeSet.h.

void ShapeSet::clear (  )  [inline]

Resets all properties to their default values

Reimplemented from PropertyMap.

Definition at line 74 of file ShapeSet.h.

PrimitiveList& ShapeSet::getPrimitives (  )  [inline]

Definition at line 78 of file ShapeSet.h.

void ShapeSet::_getUV ( SurfacePoint pt  )  const [protected, virtual]

Implements Shape.

Definition at line 136 of file ShapeSet.cpp.

void ShapeSet::_getGeometricNormal ( SurfacePoint pt  )  const [protected, virtual]

Implements Shape.

Definition at line 140 of file ShapeSet.cpp.

real_t ShapeSet::_getSurfaceArea (  )  [protected, virtual]

Returns:
the total surface area of this shape

Reimplemented from Shape.

Definition at line 123 of file ShapeSet.cpp.


Member Data Documentation

PrimitiveList ShapeSet::m_primitives [protected]

Definition at line 95 of file ShapeSet.h.

Definition at line 96 of file ShapeSet.h.

bool ShapeSet::m_ownMemory [protected]

Definition at line 97 of file ShapeSet.h.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6