Shape Class Reference
Abstract representation of a shape in 3-space. More...
#include <Shape.h>

Lazy evaluation of SurfacePoint information | |
| class | InstancedShape |
| virtual void | initSurfacePoint (SurfacePoint &pt) const |
| Initializes the given SurfacePoint which is assumed to lie on the surface of this Shape; fills in the point's UV coords, normal, and Material properties (. | |
| virtual void | _getUV (SurfacePoint &pt) const =0 |
| virtual void | _getGeometricNormal (SurfacePoint &pt) const =0 |
| virtual real_t | _getSurfaceArea () |
Public Member Functions | |
Constructors | |
| Shape (Material *material=NULL) | |
| virtual | ~Shape () |
Initialization | |
| virtual void | init () |
| Initializes this Shape for fast intersection testing. | |
Main usage interface | |
| virtual bool | hasNormal () const |
| virtual void | preview () |
| Displays a crude OpenGL preview of this shape. | |
Sampling functionality | |
| virtual void | getRandomPoint (SurfacePoint &pt) |
| virtual void | getPoint (SurfacePoint &pt, const UV &uv) |
| virtual Point3 | getPosition (const UV &uv) |
| virtual real_t | getSurfaceArea () |
Accessors / Mutators | |
| virtual AABB | getAABB () const |
| void | setMaterial (Material *material) |
| Material * | getMaterial () |
| virtual bool | isTransformable () const |
Protected Attributes | |
| AABB | m_aabb |
| World-space AABB. | |
| Material * | m_material |
| Material describing reflectance properties over this shape's surface. | |
| real_t | m_surfaceArea |
| World-space surface area of this shape. | |
Detailed Description
Abstract representation of a shape in 3-space.
- Date:
- Fall 2008
Definition at line 24 of file Shape.h.
Constructor & Destructor Documentation
Member Function Documentation
| void Shape::init | ( | ) | [virtual] |
Initializes this Shape for fast intersection testing.
- Note:
- default implementation ensures this shape has been given a valid material
must be called before getIntersection or intersects
Reimplemented from Intersectable.
Reimplemented in Blob, Implicit, InstancedShape, Mesh, Plane, PointShape, ShapeSet, Transformable, and Triangle.
| bool Shape::hasNormal | ( | ) | const [virtual] |
- Returns:
- whether or not this Shape supports the concept of a geometric surface normal defined over its surface
- Note:
- default implementation returns true
Reimplemented in InstancedShape, and PointShape.
| void Shape::preview | ( | ) | [virtual] |
Displays a crude OpenGL preview of this shape.
- Note:
- default implementation calls preview on this shape's material
Reimplemented in Blob, Cone, Cube, Cylinder, InstancedShape, Mesh, Plane, PointShape, ShapeSet, Sphere, Transformable, and Triangle.
| void Shape::getRandomPoint | ( | SurfacePoint & | pt | ) | [virtual] |
- Returns:
- a point chosen uniformly random over the surface of this shape in 'pt'
- Note:
- the probability density of selecting this point is assumed to be (1.0 / getSurfaceArea())
default implementation returns origin because not all shapes support this functionality
Reimplemented in InstancedShape, Sphere, and Triangle.
| void Shape::getPoint | ( | SurfacePoint & | pt, | |
| const UV & | uv | |||
| ) | [virtual] |
- Returns:
- the point on the surface of this shape corresponding to the given UV coordinates
- Note:
- default implementation returns origin because not all shapes support this functionality
Reimplemented in Camera, InstancedShape, Mesh, Plane, Sphere, Transformable, and Triangle.
| real_t Shape::getSurfaceArea | ( | ) | [virtual] |
- Returns:
- the total surface area of this shape
- Note:
- default implementation returns m_surfaceArea, which is assumed to be calculated at shape initialization
Reimplemented in PointShape.
| virtual AABB Shape::getAABB | ( | ) | const [inline, virtual] |
| virtual bool Shape::isTransformable | ( | ) | const [inline, virtual] |
| void Shape::initSurfacePoint | ( | SurfacePoint & | pt | ) | const [virtual] |
Initializes the given SurfacePoint which is assumed to lie on the surface of this Shape; fills in the point's UV coords, normal, and Material properties (.
- See also:
- Material::initSurfacePoint)
Reimplemented in InstancedShape.
| virtual void Shape::_getUV | ( | SurfacePoint & | pt | ) | const [protected, pure virtual] |
| virtual void Shape::_getGeometricNormal | ( | SurfacePoint & | pt | ) | const [protected, pure virtual] |
| real_t Shape::_getSurfaceArea | ( | ) | [protected, virtual] |
Friends And Related Function Documentation
friend class InstancedShape [friend] |
Member Data Documentation
AABB Shape::m_aabb [protected] |
Material* Shape::m_material [protected] |
real_t Shape::m_surfaceArea [protected] |
The documentation for this class was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6