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

SurfaceGenerator Class Reference

The SurfaceGenerator Class. More...

#include <SurfaceGenerator.h>

List of all members.

Public Member Functions

virtual MStatus compute (const MPlug &plug, MDataBlock &data)
 A virtual Function.

Static Public Member Functions

static void * creator ()
 A static Function.
static MStatus initialize ()
 A static Function.
static MPoint interpolate (double isolevel, CORNER *p1, CORNER *p2)
 A static Function.
static int polygoniseTri (CUBE cube, double iso, int v0, int v1, int v2, int v3)
 A static Function.
static int polygonise (CUBE cube, double iso)
 A static Function.
static int indexToVertex (MPoint p)
 A static Function.

Static Public Attributes

static const MTypeId typeId
 A public variabale.
static const MString typeName
 A public variabale.
static MObject ellipsoid_Radius
 A public variable.
static MObject ellipsoid_TWorldMatrix
 A public variable.
static MObject ellipsoid_Weight
 A public variable.
static MObject ellipsoid_BBoxMin
 A public variable.
static MObject ellipsoid_BBoxMax
 A public variable.
static MObject algorithm
 A public variable.
static MObject isolevel
 A public variable.
static MObject tessellation
 A public variable.
static MObject out_mesh
 A public variable.


Detailed Description

The SurfaceGenerator Class.

The SurfaceGenerator Class is responsible for extracting the iso surface of all the ImplicitFunctions connected to this SurfaceGenerator. The SurfaceGenerator extracts the iso surface through the Marching Cubes algorithm and the Marching Tetrahydra algorithm. Both implementations are taken from Paul Bourke and have been sligthly adapted in order to work with this data model.

Author:
Hannes Ricklefs

Definition at line 120 of file SurfaceGenerator.h.


Member Function Documentation

MStatus SurfaceGenerator::compute const MPlug &  plug,
MDataBlock &  data
[virtual]
 

A virtual Function.

This function is called by maya whenever the artist has changed any of the attributes that affect the ImplicitFunctions or the SurfaceGenerator. It processes the data according to the algorithm decribed in the Class declaration.c

Parameters:
plug - the output attribute to calculate
data - the data of all the connections to this node from which to read the new data.
Returns:
- the success status of this operation

Definition at line 776 of file SurfaceGenerator.cpp.

References algorithm, ImplicitSphere::applyMatrix(), ImplicitSphere::applyRadiusWeight(), CUBE::corners, ellipsoid_BBoxMax, ellipsoid_BBoxMin, ellipsoid_Radius, ellipsoid_TWorldMatrix, ellipsoid_Weight, ImplicitSphere::implicitValue(), isolevel, out_mesh, CORNER::point, polygonise(), polygoniseTri(), CORNER::scase, tessellation, CORNER::value, and ImplicitSphere::z.

void * SurfaceGenerator::creator  )  [static]
 

A static Function.

This function is called by maya to return a new instance of this node

Returns:
- the new node

Definition at line 1162 of file SurfaceGenerator.cpp.

int SurfaceGenerator::indexToVertex MPoint  p  )  [static]
 

A static Function.

Returns if the Point p already exist -1 otherwise.

Parameters:
p - the point to find
Returns:
- the index to the point or -1 if not found

Definition at line 46 of file SurfaceGenerator.cpp.

Referenced by polygonise(), and polygoniseTri().

MStatus SurfaceGenerator::initialize  )  [static]
 

A static Function.

This function initialises all the attributes of the SurfaceGenerator node

Returns:
- the success status of this operation

Definition at line 1166 of file SurfaceGenerator.cpp.

References algorithm, ellipsoid_BBoxMax, ellipsoid_BBoxMin, ellipsoid_Radius, ellipsoid_TWorldMatrix, ellipsoid_Weight, isolevel, out_mesh, and tessellation.

MPoint SurfaceGenerator::interpolate double  isolevel,
CORNER p1,
CORNER p2
[static]
 

A static Function.

This function linear interpolates between the two CORNER's given. It returns a point resulting on the linear interpolation of the two Corners in respeckt to the isolevel.

Parameters:
isolevel - the isolevel
*p1 - a pointer to the first CORNER
*p2 - a pointer to the secon CORNER
Returns:
- the resulting point

Definition at line 62 of file SurfaceGenerator.cpp.

Referenced by polygonise(), and polygoniseTri().

int SurfaceGenerator::polygonise CUBE  cube,
double  iso
[static]
 

A static Function.

This function polygonises a given CUBE depending on which of the 256 possible cases it belongs to. The implementation has been slightly adapted from the original version by Paul Bourke. http://astronomy.swin.edu.au/~pbourke/modelling/polygonise/

Parameters:
cube - the cube to be polygonised
iso - the specified iso level
Returns:
- the number of new faces added

Definition at line 381 of file SurfaceGenerator.cpp.

References CUBE::corners, indexToVertex(), interpolate(), and CORNER::value.

Referenced by compute().

int SurfaceGenerator::polygoniseTri CUBE  cube,
double  iso,
int  v0,
int  v1,
int  v2,
int  v3
[static]
 

A static Function.

This function polygonises a given triangle depending on which of the eight possible cases it belongs to. The implementation has been slightly adapted from the original version by Paul Bourke. http://astronomy.swin.edu.au/~pbourke/modelling/polytetra/ This implementation splits the give CUBE into 6 different triangles therefore in order to polygonise a CUBE one would call: PolygoniseTri(grid,iso,triangles,0,2,3,7); PolygoniseTri(grid,iso,triangles,0,2,6,7); PolygoniseTri(grid,iso,triangles,0,4,6,7); PolygoniseTri(grid,iso,triangles,0,6,1,2); PolygoniseTri(grid,iso,triangles,0,6,1,4); PolygoniseTri(grid,iso,triangles,5,6,1,4);

Parameters:
cube - the CUBE to be polygonised
iso - the specified iso level
v0 - the first CORNER position in the CUBE
v1 - the second CORNER position in the CUBE
v2 - the third CORNER position in the CUBE
v3 - the fourth CORNER position in the CUBE
Returns:
- the number of new faces added

Definition at line 81 of file SurfaceGenerator.cpp.

References CUBE::corners, indexToVertex(), interpolate(), and CORNER::value.

Referenced by compute().


Member Data Documentation

MObject SurfaceGenerator::algorithm [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator of the current algorithm to extract the iso surface

Definition at line 19 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::ellipsoid_BBoxMax [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator to all the connections of the the min bounding box attributes of all the ImplicitSpheres connected to this SurfaceGenerator

Definition at line 14 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::ellipsoid_BBoxMin [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator to all the connections of the min bounding box attributes of all the ImplicitSpheres connected to this SurfaceGenerator

Definition at line 13 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::ellipsoid_Radius [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator to all the connections of the radius attributes of all the ImplicitSpheres connected to this SurfaceGenerator

Definition at line 10 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::ellipsoid_TWorldMatrix [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator to all the connections of the transformation matrix attributes of all the ImplicitSpheres connected to this SurfaceGenerator

Definition at line 11 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::ellipsoid_Weight [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator to all the connections of the weight attributes of all the ImplicitSpheres connected to this SurfaceGenerator

Definition at line 12 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::isolevel [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator to the current iso level of the to be extracted iso surface

Definition at line 18 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::out_mesh [static]
 

A public variable.

Represents the generated mesh attribute as an output variable of this SurfaceGenerator

Definition at line 39 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

MObject SurfaceGenerator::tessellation [static]
 

A public variable.

Represents an attribute of this SurfaceGenerator specifying the tessellation of the 3D volume when generating the either of the iso surface extraction algorithms

Definition at line 17 of file SurfaceGenerator.cpp.

Referenced by compute(), and initialize().

const MTypeId SurfaceGenerator::typeId [static]
 

A public variabale.

The unique type ID of this custom node

const MString SurfaceGenerator::typeName [static]
 

A public variabale.

The unique type name of this custom node


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