|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectartofillusion.object.Object3D
artofillusion.object.SplineMesh
public class SplineMesh
The SplineMesh class represents a parametric surface defined as a tensor product of spline curves. Depending on the selected smoothing method, the surface may either interpolate or approximate the vertices of the control mesh.
| Nested Class Summary | |
|---|---|
static class |
SplineMesh.SplineMeshKeyframe
This class represents a pose of a SplineMesh. |
| Field Summary |
|---|
| Fields inherited from class artofillusion.object.Object3D |
|---|
APPROXIMATELY, CANT_CONVERT, EXACTLY |
| Fields inherited from interface artofillusion.object.Mesh |
|---|
APPROXIMATING, INTERPOLATING, NO_SMOOTHING, SMOOTH_SHADING |
| Constructor Summary | |
|---|---|
SplineMesh(java.io.DataInputStream in,
Scene theScene)
The following two methods are used for reading and writing files. |
|
SplineMesh(Vec3[][] v,
float[] usmoothness,
float[] vsmoothness,
int smoothingMethod,
boolean uclosed,
boolean vclosed)
v is an array containing the points of the control mesh, with the first index corresponding to the U direction, and the second to the V direction. |
|
| Method Summary | |
|---|---|
void |
applyPoseKeyframe(Keyframe k)
Modify this object based on a pose keyframe. |
static MeshVertex |
calcApproxPoint(MeshVertex[] v,
float[] s,
double[][] oldParam,
double[] newParam,
int i,
int j,
int k)
|
static MeshVertex |
calcInterpPoint(MeshVertex[] v,
float[] s,
double[][] oldParam,
double[] newParam,
int i,
int j,
int k,
int m)
The following two routines are used by subdivideMesh to calculate new point positions for interpolating and approximating subdivision. |
boolean |
canConvertToActor()
Allow SplineMeshes to be converted to Actors. |
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 |
copyObject(Object3D obj)
Copy all the properties of another object, to make this one identical to it. |
MeshViewer |
createMeshViewer(MeshEditController controller,
buoy.widget.RowContainer options)
Get a MeshViewer which can be used for viewing this mesh. |
Object3D |
duplicate()
Create a new object which is an exact duplicate of this one. |
void |
edit(EditingWindow parent,
ObjectInfo info,
java.lang.Runnable cb)
Display a window in which the user can edit this object. |
void |
editGesture(EditingWindow parent,
ObjectInfo info,
java.lang.Runnable cb,
ObjectInfo realObject)
Edit an object which represents a gesture for an Actor object. |
BoundingBox |
getBounds()
Get the bounding box for the mesh. |
Vec3[] |
getNormals()
Get an array of normal vectors. |
Object3D |
getPosableObject()
SplineMeshes cannot be keyframed directly, since any change to mesh topology would cause all keyframes to become invalid. |
Keyframe |
getPoseKeyframe()
Return a Keyframe which describes the current pose of this object. |
Property[] |
getProperties()
Get a list of editable properties defined by this object. |
java.lang.Object |
getPropertyValue(int index)
Get the value of one of this object's editable properties. |
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. |
Skeleton |
getSkeleton()
Get the skeleton for the object. |
int |
getSmoothingMethod()
Get the smoothing method being used for this mesh. |
int |
getUSize()
Get the size of the mesh in the U direction. |
float[] |
getUSmoothness()
Get the array of U smoothness values. |
MeshVertex |
getVertex(int u,
int v)
Get a single vertex. |
Vec3[] |
getVertexPositions()
Get a list of the positions of all vertices which define the mesh. |
MeshVertex[] |
getVertices()
Return the list of vertices for the mesh. |
int |
getVSize()
Get the size of the mesh in the V direction. |
float[] |
getVSmoothness()
Get the array of V smoothness values. |
WireframeMesh |
getWireframeMesh()
Every object should override this method to return a WireframeMesh. |
boolean |
isClosed()
Determine whether this mesh is completely closed. |
boolean |
isEditable()
If the object can be edited by the user, isEditable() should be overridden to return true. |
boolean |
isUClosed()
Determine whether this mesh is closed in the U direction. |
boolean |
isVClosed()
Determine whether this mesh is closed in the V direction. |
void |
makeRightSideOut()
If necessary, reorder the points in the mesh so that, when converted to a triangle mesh for rendering, the normals will be properly oriented. |
void |
reverseOrientation()
Reverse the points along one direction. |
void |
setClosed(boolean u,
boolean v)
Set whether this mesh is closed in each direction. |
void |
setParameterValue(TextureParameter param,
ParameterValue val)
When setting texture parameters, we need to clear the caches. |
void |
setParameterValues(ParameterValue[] val)
When setting texture parameters, we need to clear the caches. |
void |
setPropertyValue(int index,
java.lang.Object value)
Set the value of one of this object's editable properties. |
void |
setShape(MeshVertex[][] v,
float[] usmoothness,
float[] vsmoothness)
This method rebuilds the mesh based on new lists of vertices and smoothness values. |
void |
setSize(double xsize,
double ysize,
double zsize)
Set the size of the mesh. |
void |
setSkeleton(Skeleton s)
Set the skeleton for the object. |
void |
setSmoothingMethod(int method)
Set the smoothing method. |
void |
setSmoothness(float[] usmoothness,
float[] vsmoothness)
Set the smoothness values. |
void |
setTexture(Texture tex,
TextureMapping mapping)
When setting the texture, we need to clear the caches. |
void |
setVertexPositions(Vec3[] v)
Set the positions for all the vertices of the mesh. |
static SplineMesh |
subdivideMesh(SplineMesh mesh,
double tol)
Subdivide a spline mesh to a desired tolerance. |
void |
writeToFile(java.io.DataOutputStream out,
Scene theScene)
The following method writes the object's data to an output stream. |
| Methods inherited from class artofillusion.object.Object3D |
|---|
canSetMaterial, canSetTexture, configurePoseTrack, copyTextureAndMaterial, editKeyframe, getAverageParameterValues, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getTexture, getTextureMapping, readParameterValue, renderObject, sceneChanged, setMaterial, setParameters |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface artofillusion.object.Mesh |
|---|
getParameters, getParameterValues |
| Constructor Detail |
|---|
public SplineMesh(Vec3[][] v,
float[] usmoothness,
float[] vsmoothness,
int smoothingMethod,
boolean uclosed,
boolean vclosed)
public SplineMesh(java.io.DataInputStream in,
Scene theScene)
throws java.io.IOException,
java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException| Method Detail |
|---|
public Object3D duplicate()
Object3D
duplicate in interface Meshduplicate in class Object3Dpublic void copyObject(Object3D obj)
Object3D
copyObject in interface MeshcopyObject in class Object3Dpublic BoundingBox getBounds()
getBounds in interface MeshgetBounds in class Object3Dpublic MeshVertex[] getVertices()
getVertices in interface Mesh
public final MeshVertex getVertex(int u,
int v)
public final int getUSize()
public final int getVSize()
public int getSmoothingMethod()
public float[] getUSmoothness()
public float[] getVSmoothness()
public Vec3[] getVertexPositions()
getVertexPositions in interface Meshpublic void setVertexPositions(Vec3[] v)
setVertexPositions in interface Meshpublic void setSmoothingMethod(int method)
public void setSmoothness(float[] usmoothness,
float[] vsmoothness)
public void setShape(MeshVertex[][] v,
float[] usmoothness,
float[] vsmoothness)
public boolean isUClosed()
public boolean isVClosed()
public boolean isClosed()
isClosed in class Object3D
public void setClosed(boolean u,
boolean v)
public void setSize(double xsize,
double ysize,
double zsize)
setSize in class Object3Dpublic boolean isEditable()
Object3D
isEditable in class Object3D
public void edit(EditingWindow parent,
ObjectInfo info,
java.lang.Runnable cb)
Object3D
edit in class Object3Dparent - the window from which this command is being invokedinfo - the ObjectInfo corresponding to this objectcb - a callback which will be executed when editing is complete. If the user
cancels the operation, it will not be called.
public void editGesture(EditingWindow parent,
ObjectInfo info,
java.lang.Runnable cb,
ObjectInfo realObject)
Object3D
editGesture in class Object3D
public MeshViewer createMeshViewer(MeshEditController controller,
buoy.widget.RowContainer options)
createMeshViewer in interface Mesh
public static SplineMesh subdivideMesh(SplineMesh mesh,
double tol)
public static MeshVertex calcInterpPoint(MeshVertex[] v,
float[] s,
double[][] oldParam,
double[] newParam,
int i,
int j,
int k,
int m)
public static MeshVertex calcApproxPoint(MeshVertex[] v,
float[] s,
double[][] oldParam,
double[] newParam,
int i,
int j,
int k)
public WireframeMesh getWireframeMesh()
Object3D
getWireframeMesh in class Object3D
public RenderingMesh getRenderingMesh(double tol,
boolean interactive,
ObjectInfo info)
Object3DThe 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 Object3Dpublic int canConvertToTriangleMesh()
Object3D
canConvertToTriangleMesh in class Object3Dpublic TriangleMesh convertToTriangleMesh(double tol)
Object3D
convertToTriangleMesh in class Object3D
public void setTexture(Texture tex,
TextureMapping mapping)
setTexture in class Object3Dpublic void setParameterValues(ParameterValue[] val)
setParameterValues in class Object3D
public void setParameterValue(TextureParameter param,
ParameterValue val)
setParameterValue in class Object3Dpublic Skeleton getSkeleton()
getSkeleton in interface MeshgetSkeleton in class Object3Dpublic void setSkeleton(Skeleton s)
setSkeleton in interface Mesh
public void writeToFile(java.io.DataOutputStream out,
Scene theScene)
throws java.io.IOException
Object3D
writeToFile in class Object3Djava.io.IOExceptionpublic void makeRightSideOut()
public void reverseOrientation()
public Vec3[] getNormals()
getNormals in interface Meshpublic Property[] getProperties()
Object3D
getProperties in class Object3Dpublic java.lang.Object getPropertyValue(int index)
Object3D
getPropertyValue in class Object3Dindex - the index of the property to get
public void setPropertyValue(int index,
java.lang.Object value)
Object3D
setPropertyValue in class Object3Dindex - the index of the property to setvalue - the value to set for the propertypublic Keyframe getPoseKeyframe()
getPoseKeyframe in class Object3Dpublic void applyPoseKeyframe(Keyframe k)
applyPoseKeyframe in class Object3Dpublic boolean canConvertToActor()
canConvertToActor in class Object3Dpublic Object3D getPosableObject()
getPosableObject in class Object3D
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||