|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.object.Object3D
artofillusion.object.Curve
public class Curve
The Curve class represents a continuous curve defined by a series of control vertices. It may be either open or closed, and may either interpolate or approximate the control vertices. There is also a smoothness parameter associated with each vertex.
Nested Class Summary | |
---|---|
static class |
Curve.CurveKeyframe
This class represents a pose of a Curve. |
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 | |
---|---|
Curve(java.io.DataInputStream in,
Scene theScene)
The following two methods are used for reading and writing files. |
|
Curve(Vec3[] v,
float[] smoothness,
int smoothingMethod,
boolean isClosed)
|
Method Summary | |
---|---|
void |
applyPoseKeyframe(Keyframe k)
Modify this object based on a pose keyframe. |
static Vec3 |
calcApproxPoint(Vec3[] v,
float[] s,
int i,
int j,
int k)
|
static Vec3 |
calcInterpPoint(Vec3[] v,
float[] s,
int i,
int j,
int k,
int m)
The following two routines are used by subdivideCurve to calculate new point positions for interpolating and approximating subdivision. |
boolean |
canConvertToActor()
Determine whether the user should be allowed to convert this object to an Actor. |
int |
canConvertToTriangleMesh()
Tells whether the object can be converted to a TriangleMesh. |
boolean |
canSetTexture()
This method tells whether textures can be assigned to the object. |
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,
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 a BoundingBox which just encloses the object. |
Vec3[] |
getNormals()
Normal vectors do not make sense for a curve, since it does not define a surface. |
Object3D |
getPosableObject()
Curves 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. |
Skeleton |
getSkeleton()
Get the skeleton. |
int |
getSmoothingMethod()
Get the smoothing method being used for this mesh. |
float[] |
getSmoothness()
|
Vec3[] |
getVertexPositions()
Get a list of the positions of all vertices which define the mesh. |
MeshVertex[] |
getVertices()
Get the list of vertices which define the mesh. |
WireframeMesh |
getWireframeMesh()
Every object should override this method to return a WireframeMesh. |
boolean |
isClosed()
Tells whether the object is closed. |
boolean |
isEditable()
If the object can be edited by the user, isEditable() should be overridden to return true. |
void |
movePoint(int which,
Vec3 pos)
Move a single control vertex. |
void |
setClosed(boolean isClosed)
|
void |
setPropertyValue(int index,
java.lang.Object value)
Set the value of one of this object's editable properties. |
void |
setShape(Vec3[] v,
float[] smoothness)
Set both the positions and smoothness values for all points. |
void |
setSize(double xsize,
double ysize,
double zsize)
Resize the object. |
void |
setSkeleton(Skeleton s)
Set the skeleton. |
void |
setSmoothingMethod(int method)
Set the smoothing method. |
void |
setSmoothness(float[] s)
Set the smoothness values for all vertices. |
void |
setVertexPositions(Vec3[] v)
Set new positions for all vertices. |
Curve |
subdivideCurve()
Return a new Curve object which has been subdivided once to give a finer approximation of the curve shape. |
Curve |
subdivideCurve(int times)
Return a new Curve object which has been subdivided the specified number of times to give a finer approximation of the curve shape. |
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, configurePoseTrack, copyTextureAndMaterial, editKeyframe, getAverageParameterValues, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getRenderingMesh, getTexture, getTextureMapping, readParameterValue, renderObject, sceneChanged, setMaterial, setParameters, setParameterValue, setParameterValues, setTexture |
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 Curve(Vec3[] v, float[] smoothness, int smoothingMethod, boolean isClosed)
public Curve(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 Mesh
duplicate
in class Object3D
public void copyObject(Object3D obj)
Object3D
copyObject
in interface Mesh
copyObject
in class Object3D
public BoundingBox getBounds()
Object3D
getBounds
in interface Mesh
getBounds
in class Object3D
public MeshVertex[] getVertices()
Mesh
getVertices
in interface Mesh
public float[] getSmoothness()
public int getSmoothingMethod()
public void movePoint(int which, Vec3 pos)
public Vec3[] getVertexPositions()
getVertexPositions
in interface Mesh
public void setVertexPositions(Vec3[] v)
setVertexPositions
in interface Mesh
public void setSmoothingMethod(int method)
public void setSmoothness(float[] s)
public void setShape(Vec3[] v, float[] smoothness)
public void setClosed(boolean isClosed)
public boolean isClosed()
Object3D
isClosed
in class Object3D
public void setSize(double xsize, double ysize, double zsize)
Object3D
setSize
in class Object3D
public WireframeMesh getWireframeMesh()
Object3D
getWireframeMesh
in class Object3D
public Curve subdivideCurve()
public Curve subdivideCurve(int times)
public static Vec3 calcInterpPoint(Vec3[] v, float[] s, int i, int j, int k, int m)
public static Vec3 calcApproxPoint(Vec3[] v, float[] s, int i, int j, int k)
public boolean canSetTexture()
Object3D
canSetTexture
in class Object3D
public int canConvertToTriangleMesh()
Object3D
canConvertToTriangleMesh
in class Object3D
public TriangleMesh convertToTriangleMesh(double tol)
Object3D
convertToTriangleMesh
in class Object3D
public Vec3[] getNormals()
getNormals
in interface Mesh
public boolean isEditable()
Object3D
isEditable
in class Object3D
public Skeleton getSkeleton()
getSkeleton
in interface Mesh
getSkeleton
in class Object3D
public void setSkeleton(Skeleton s)
setSkeleton
in interface Mesh
public void edit(EditingWindow parent, ObjectInfo info, java.lang.Runnable cb)
Object3D
edit
in class Object3D
parent
- 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, RowContainer options)
createMeshViewer
in interface Mesh
public void writeToFile(java.io.DataOutputStream out, Scene theScene) throws java.io.IOException
Object3D
writeToFile
in class Object3D
java.io.IOException
public Property[] getProperties()
Object3D
getProperties
in class Object3D
public java.lang.Object getPropertyValue(int index)
Object3D
getPropertyValue
in class Object3D
index
- the index of the property to getpublic void setPropertyValue(int index, java.lang.Object value)
Object3D
setPropertyValue
in class Object3D
index
- the index of the property to setvalue
- the value to set for the propertypublic Keyframe getPoseKeyframe()
getPoseKeyframe
in class Object3D
public void applyPoseKeyframe(Keyframe k)
applyPoseKeyframe
in class Object3D
public boolean canConvertToActor()
Object3D
canConvertToActor
in class Object3D
public Object3D getPosableObject()
getPosableObject
in class Object3D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |