Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

ImplicitSphere Class Reference

The ImplicitSphere Class. More...

#include <ImplicitSphere.h>

Inherits ImplicitFunction.

List of all members.

Public Member Functions

 ImplicitSphere (MDistance r, float w, MPoint c)
 The Constructor.
virtual ~ImplicitSphere ()
 The Destructor.
virtual float implicitValue (MPoint p)
 An virutal Function.
virtual void applyMatrix (MTransformationMatrix matrix)
 An virutal Function.
virtual void applyRadiusWeight (MDistance r, float w)
 An virutal Function.
virtual bool testInfluance (MPoint p)
 An virutal Function.

Public Attributes

MDistance radius
 A public variable.
MPoint center
 A public variable.
double a
 A public variable.
double b
 A public variable.
double z
 A public variable.


Detailed Description

The ImplicitSphere Class.

The ImplicitSphere class represents the mathematical formulation of a "metaball". It uses the function of an ellipsoid as of http://www.hyperfun.org to calculate the implicit function value. It extends the ImplicitFunction class in order to provide the relevant methods to SurfaceGenerator.

See also:
ImplicitFunction
Author:
Hannes Ricklefs

Definition at line 31 of file ImplicitSphere.h.


Constructor & Destructor Documentation

ImplicitSphere::ImplicitSphere MDistance  r,
float  w,
MPoint  c
 

The Constructor.

This Constructor initalises and ImplicitSphere given the specified values. The initial radius passed in will be split into a, b, z in order to calculate the correct function of the ellipsoid. This enables the scaling of the metaball in and direction. It assumes that the initial ImplicitSphere is actually a sphere. The radius is passed in as a MDistance and not as an MFloat to comply with Maya's ability to specify different scales in which to calculate the size of an object.

Parameters:
r - the initial radius
f - the initial weight
c - the initial center position.

Definition at line 9 of file ImplicitSphere.cpp.

References a, b, center, radius, and z.

virtual ImplicitSphere::~ImplicitSphere  )  [inline, virtual]
 

The Destructor.

Destructs this ImplicitSphere

Definition at line 55 of file ImplicitSphere.h.


Member Function Documentation

void ImplicitSphere::applyMatrix MTransformationMatrix  matrix  )  [virtual]
 

An virutal Function.

Applies the given Transformation matrix in order to update the location in 3D space where to calculate the implicit function value. This enables the ImplicitSphere to be moved around in the Maya view port.

Parameters:
matrix - the new TransformationMatrix

Implements ImplicitFunction.

Definition at line 35 of file ImplicitSphere.cpp.

Referenced by SurfaceGenerator::compute().

void ImplicitSphere::applyRadiusWeight MDistance  r,
float  w
[virtual]
 

An virutal Function.

Applies the given radius to this ImplicitSphere. It sets the new radius to the a, b, z value in order to calculate the function of the ellipsoid.

Parameters:
r - the new radius

Definition at line 39 of file ImplicitSphere.cpp.

References a, b, radius, and z.

Referenced by SurfaceGenerator::compute().

float ImplicitSphere::implicitValue MPoint  p  )  [virtual]
 

An virutal Function.

Return the implicit function value for this ImplicitSphere for the given point p. The method first translates the given point according to the current transformation matrix. This enables this ImplicitSphere to be translated, rotated and scaled within the Maya viewport. After translation it calculates the implicit function value based on the formala of an ellipsoid as specified on http://www.hyperfun.org.

f(p)=1-((p.x-center.x)/a)^2-((p.y-center.y)/b)^2-((p.z-center.z)/z)^2

Parameters:
p - the point in 3D space to test
Returns:
- the calculate implicit function value

Implements ImplicitFunction.

Definition at line 20 of file ImplicitSphere.cpp.

References a, b, center, and z.

Referenced by SurfaceGenerator::compute(), and testInfluance().

bool ImplicitSphere::testInfluance MPoint  p  )  [virtual]
 

An virutal Function.

Returns if the given point p is within the influence radius of this ImplicitSphere.

Parameters:
p - the point in 3D space to test
Returns:
- returns true if inside the implicit function radius. false otherwise

Implements ImplicitFunction.

Definition at line 47 of file ImplicitSphere.cpp.

References implicitValue().


Member Data Documentation

double ImplicitSphere::a
 

A public variable.

The a value for calculating the ellispsoid

Definition at line 125 of file ImplicitSphere.h.

Referenced by applyRadiusWeight(), ImplicitSphere(), and implicitValue().

double ImplicitSphere::b
 

A public variable.

The b value for calculating the ellispsoid

Definition at line 131 of file ImplicitSphere.h.

Referenced by applyRadiusWeight(), ImplicitSphere(), and implicitValue().

MPoint ImplicitSphere::center
 

A public variable.

The center of this ImplicitSphere

Definition at line 119 of file ImplicitSphere.h.

Referenced by ImplicitSphere(), and implicitValue().

MDistance ImplicitSphere::radius
 

A public variable.

The radius of this ImplicitSphere

Definition at line 113 of file ImplicitSphere.h.

Referenced by applyRadiusWeight(), and ImplicitSphere().

double ImplicitSphere::z
 

A public variable.

The z value for calculating the ellispsoid

Definition at line 137 of file ImplicitSphere.h.

Referenced by applyRadiusWeight(), SurfaceGenerator::compute(), ImplicitSphere(), and implicitValue().


The documentation for this class was generated from the following files:
Generated on Mon Jun 13 03:18:00 2005 for ImplicitFunctions by  doxygen 1.4.1