|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.object.Object3D
artofillusion.object.ImplicitObject
public abstract class ImplicitObject
This abstract class represents an object whose surface is defined as an isosurface of a 3D field function. Subclasses define the function and isosurface value used to generate a particular surface. More precisely, the interior of the object is defined to consist of all points which satisfy the following conditions:
Field Summary |
---|
Fields inherited from class artofillusion.object.Object3D |
---|
APPROXIMATELY, CANT_CONVERT, EXACTLY |
Constructor Summary | |
---|---|
ImplicitObject()
The default constructor does nothing. |
|
ImplicitObject(java.io.DataInputStream in,
Scene theScene)
Subclasses should invoke this method in their own constructors for loading from a file. |
Method Summary | |
---|---|
int |
canConvertToTriangleMesh()
Tells whether the object can be converted to a TriangleMesh. |
TriangleMesh |
convertToTriangleMesh(double tol)
Return a TriangleMesh which reproduces the shape of this object. |
void |
generateMesh(double tol,
java.util.List<Vec3> vertices,
java.util.List<int[]> faces)
Construct a mesh from the implicit function. |
double |
getCutoff()
Get the cutoff value which defines the surface of the object. |
void |
getFieldGradient(double x,
double y,
double z,
double size,
double time,
Vec3 grad)
Get the gradient of the field function at a point specified in object coordinates. |
abstract double |
getFieldValue(double x,
double y,
double z,
double size,
double time)
Get the value of the field function at a point specified in object coordinates. |
double |
getMaxGradient()
Get the maximum value which can ever occur for the absolute value of the field gradient. |
abstract boolean |
getPreferDirectRendering()
Get the preferred rendering method to use when this object is rendered by a renderer that supports direct evaluation of the field. |
RenderingMesh |
getRenderingMesh(double tol,
boolean interactive,
ObjectInfo info)
Objects which can be rendered as part of a scene should override this method to return a RenderingMesh which describes the appearance of the object. |
WireframeMesh |
getWireframeMesh()
Every object should override this method to return a WireframeMesh. |
void |
sceneChanged(ObjectInfo info,
Scene scene)
This will be called whenever this object is moved, or the time changes. |
void |
writeToFile(java.io.DataOutputStream out,
Scene theScene)
Subclasses should invoke this method in their own writeToFile() methods. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImplicitObject()
public ImplicitObject(java.io.DataInputStream in, Scene theScene) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
Method Detail |
---|
public abstract double getFieldValue(double x, double y, double z, double size, double time)
x
- the x coordinate of the location at which to evaluate the functiony
- the y coordinate of the location at which to evaluate the functionz
- the z coordinate of the location at which to evaluate the functionsize
- the width of the region over which to average the function for antialiasingtime
- the time at which the function is being evaluated
public void getFieldGradient(double x, double y, double z, double size, double time, Vec3 grad)
The default implementation of this method estimates the gradient by evaluating the field function at several closely spaced points. In many cases, it is possible to calculate the gradient both more quickly and more accurately by analytical means. Whenever possible, this method should be overridden to calculate the gradient directly.
x
- the x coordinate of the location at which to evaluate the functiony
- the y coordinate of the location at which to evaluate the functionz
- the z coordinate of the location at which to evaluate the functionsize
- the width of the region over which to average the function for antialiasingtime
- the time at which the function is being evaluatedgrad
- on exit, this should be set equal to the gradient of the field function at
the specified locationpublic double getMaxGradient()
public double getCutoff()
The default implementation returns 1.0. It may be overridden to return a different value.
public abstract boolean getPreferDirectRendering()
public void writeToFile(java.io.DataOutputStream out, Scene theScene) throws java.io.IOException
writeToFile
in class Object3D
java.io.IOException
public int canConvertToTriangleMesh()
Object3D
canConvertToTriangleMesh
in class Object3D
public TriangleMesh convertToTriangleMesh(double tol)
Object3D
convertToTriangleMesh
in class Object3D
public RenderingMesh getRenderingMesh(double tol, boolean interactive, ObjectInfo info)
Object3D
The ObjectInfo contains additional information which may affect how the object is rendered, such as it location in the scene, texture parameters, etc.
Objects which cannot be rendered directly (lights, cameras, curves, etc.) do not need to override this method.
getRenderingMesh
in class Object3D
public WireframeMesh getWireframeMesh()
Object3D
getWireframeMesh
in class Object3D
public void sceneChanged(ObjectInfo info, Scene scene)
Object3D
sceneChanged
in class Object3D
public void generateMesh(double tol, java.util.List<Vec3> vertices, java.util.List<int[]> faces)
tol
- the surface error tolerancevertices
- the coordinates of mesh vertices will be added to this Listfaces
- an int[3] will be added to this List containing the vertex indices for each mesh face
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |