Blob Class Reference

Blobby isosurface composed of a set of MetaObjects, all of which combine to form a scalar field whose contour at this blob's threshold value defines the surface. Upon initialization (Blob::init), the implicit surface is polygonized into triangles using a variant of the well-known Marching Cubes algorithm. A MetaObject exerts a positive or negative 'charge' in a scalar field, whose isocontours (level sets) define blobby surfaces with different threshold values corresponding to the contour level. MetaObjects positively or negatively affect their neighboring MetaObjects depending on their 'strength' and 'negative' attributes. More...

#include <Blob.h>

Inheritance diagram for Blob:

MetaObject Transformable ScalarField PropertyMap Shape Intersectable SSEAligned

List of all members.

Public Member Functions

Constructors
 Blob (real_t threshold=(0.17))
 Blob (const MetaObjectList &metaObjects, real_t threshold=(0.17))
virtual ~Blob ()
Core functionality
virtual void init ()
 Performs any initialization which may be necessary before calling getAABB or evaluate.
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).
virtual real_t evaluate (const Point3 &pt) const
Accessors / Mutators
real_t getThreshold () const
void setThreshold (real_t threshold)
 sets the threshold spcifying the boundary of this blobby surface
MeshgetMesh ()
void push_back (MetaObject *meta)
 adds the given MetaObject to this blob
MetaObjectList & getMetaObjects ()
virtual AABB getAABB () const

Protected Member Functions

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

Protected Attributes

MetaObjectList m_metaObjects
Meshm_mesh
real_t m_threshold


Detailed Description

Blobby isosurface composed of a set of MetaObjects, all of which combine to form a scalar field whose contour at this blob's threshold value defines the surface. Upon initialization (Blob::init), the implicit surface is polygonized into triangles using a variant of the well-known Marching Cubes algorithm. A MetaObject exerts a positive or negative 'charge' in a scalar field, whose isocontours (level sets) define blobby surfaces with different threshold values corresponding to the contour level. MetaObjects positively or negatively affect their neighboring MetaObjects depending on their 'strength' and 'negative' attributes.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Spring 2008
Parameters:
threshold - specifies the particular isocontour boundary which will define the surface of this blobby shape (defaults to BLOB_THRESHOLD_DEFAULT)
See also:
also MetaObject

Definition at line 38 of file Blob.h.


Constructor & Destructor Documentation

Blob::Blob ( real_t  threshold = (0.17)  )  [inline]

Definition at line 43 of file Blob.h.

Blob::Blob ( const MetaObjectList &  metaObjects,
real_t  threshold = (0.17) 
) [inline]

Definition at line 48 of file Blob.h.

Blob::~Blob (  )  [virtual]

Definition at line 23 of file Blob.cpp.


Member Function Documentation

void Blob::init (  )  [virtual]

Performs any initialization which may be necessary before calling getAABB or evaluate.

Note:
Implementations will likely want to precompute their AABB in init and store it for later since getAABB may be called often

Default implementation synchs parameters from PropertyMap

Reimplemented from MetaObject.

Definition at line 33 of file Blob.cpp.

void Blob::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 86 of file Blob.cpp.

real_t Blob::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 93 of file Blob.cpp.

bool Blob::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 104 of file Blob.cpp.

real_t Blob::evaluate ( const Point3 pt  )  const [virtual]

Returns:
the aggregate charge at the given point
Note:
If the given point is outside of this Blob's AABB, evaluate is assumed to return zero

Implements MetaObject.

Definition at line 115 of file Blob.cpp.

real_t Blob::getThreshold (  )  const [inline]

Returns:
the threshold spcifying the boundary of this blobby surface

Definition at line 86 of file Blob.h.

void Blob::setThreshold ( real_t  threshold  )  [inline]

sets the threshold spcifying the boundary of this blobby surface

Definition at line 94 of file Blob.h.

Mesh* Blob::getMesh (  )  [inline]

Returns:
the underlying mesh generated from marching cubes

Definition at line 101 of file Blob.h.

void Blob::push_back ( MetaObject meta  )  [inline]

adds the given MetaObject to this blob

Definition at line 109 of file Blob.h.

MetaObjectList& Blob::getMetaObjects (  )  [inline]

Definition at line 115 of file Blob.h.

AABB Blob::getAABB (  )  const [virtual]

Returns:
the bounding box of influence which bounds the range in which this MetaObject may have a non-zero charge

Implements MetaObject.

Definition at line 130 of file Blob.cpp.

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

Implements Shape.

Definition at line 134 of file Blob.cpp.

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

Implements Shape.

Definition at line 138 of file Blob.cpp.


Member Data Documentation

MetaObjectList Blob::m_metaObjects [protected]

Definition at line 129 of file Blob.h.

Mesh* Blob::m_mesh [protected]

Definition at line 130 of file Blob.h.

Definition at line 132 of file Blob.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6