|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.Scene
public class Scene
The Scene class describes a collection of objects, arranged relative to each other to form a scene, as well as the available textures and materials, environment options, etc.
Field Summary | |
---|---|
static int |
ENVIRON_DIFFUSE
|
static int |
ENVIRON_EMISSIVE
|
static int |
ENVIRON_SOLID
|
static int |
HANDLE_SIZE
|
Constructor Summary | |
---|---|
Scene()
|
|
Scene(java.io.DataInputStream in,
boolean fullScene)
The following constructor is used for reading from arbitrary input streams. |
|
Scene(java.io.File f,
boolean fullScene)
The following constructor is used for reading files. |
Method Summary | |
---|---|
void |
addImage(ImageMap im)
Add an image map to the scene. |
void |
addMaterial(Material mat)
Add a new Material to the scene. |
void |
addMaterial(Material mat,
int index)
Add a new Material to the scene. |
void |
addMaterialListener(ListChangeListener ls)
Add an object which wants to be notified when the list of Materials in the Scene changes. |
void |
addObject(Object3D obj,
CoordinateSystem coords,
java.lang.String name,
UndoRecord undo)
Add a new object to the scene. |
void |
addObject(ObjectInfo info,
int index,
UndoRecord undo)
Add a new object to the scene in the specified position. |
void |
addObject(ObjectInfo info,
UndoRecord undo)
Add a new object to the scene. |
void |
addTexture(Texture tex)
Add a new Texture to the scene. |
void |
addTexture(Texture tex,
int index)
Add a new Texture to the scene. |
void |
addTextureListener(ListChangeListener ls)
Add an object which wants to be notified when the list of Textures in the Scene changes. |
void |
addToSelection(int which)
Deprecated. Call addToSelection() on the LayoutWindow instead. |
void |
applyTracksAfterModification(java.util.Collection<ObjectInfo> changedObjects)
This should be called after one or more objects have been modified by the user. |
void |
applyTracksToObject(ObjectInfo info)
Modify an object (and any objects that depend on it) based on its tracks at the current time. |
void |
changeMaterial(int which)
This method should be called after a Material has been edited. |
void |
changeTexture(int which)
This method should be called after a Texture has been edited. |
void |
clearSelection()
Deprecated. Call clearSelection() on the LayoutWindow instead. |
boolean |
errorsOccurredInLoading()
Return true if any errors occurred while loading the scene. |
java.util.Set<java.lang.String> |
getAllMetadataNames()
Get the names of all metadata objects stored in this scene. |
java.util.List<ObjectInfo> |
getAllObjects()
Get all objects in the Scene in the form of a List. |
RGBColor |
getAmbientColor()
Get the scene's ambient light color. |
Texture |
getDefaultTexture()
Get the default Texture for newly created objects. |
java.lang.String |
getDirectory()
Get the directory on disk in which this scene is saved. |
RGBColor |
getEnvironmentColor()
Get the environment color. |
TextureMapping |
getEnvironmentMapping()
Get the TextureMapping being used to map the environment map texture to the environment sphere. |
int |
getEnvironmentMode()
Get the Scene's environment mapping mode. |
ParameterValue[] |
getEnvironmentParameterValues()
Get the parameter values used for the environment map. |
Texture |
getEnvironmentTexture()
Get the texture being used as an environment mapping. |
RGBColor |
getFogColor()
Get the fog color. |
double |
getFogDistance()
Get the length constant for exponential fog. |
boolean |
getFogState()
Determine whether fog is enabled. |
int |
getFramesPerSecond()
Get the number of frames per second. |
double |
getGridSpacing()
Get the grid spacing. |
int |
getGridSubdivisions()
Get the number of grid snap-to subdivisions. |
ImageMap |
getImage(int i)
Get the i'th image map. |
java.lang.String |
getLoadingErrors()
Get a description of any errors which occurred while loading the scene. |
Material |
getMaterial(int i)
Get the i'th material. |
Material |
getMaterial(java.lang.String name)
Get the material with the specified name, or null if there is none. |
java.lang.Object |
getMetadata(java.lang.String name)
Get a piece of metadata stored in this scene. |
java.lang.String |
getName()
Get the name of this scene. |
int |
getNumImages()
Get the number of image maps in this scene. |
int |
getNumMaterials()
Get the number of materials in this scene. |
int |
getNumObjects()
Get the number of objects in this scene. |
int |
getNumTextures()
Get the number of textures in this scene. |
ObjectInfo |
getObject(int i)
Get the i'th object. |
ObjectInfo |
getObject(java.lang.String name)
Get the object with the specified name, or null if there is none. |
ObjectInfo |
getObjectById(int id)
Get the object with the specified ID, or null if there is none. |
int[] |
getSelection()
Deprecated. Call getSelectedIndices() or getSelectedObjects() on the LayoutWindow instead. |
int[] |
getSelectionWithChildren()
Deprecated. Call getSelectionWithChildren() on the LayoutWindow instead. |
boolean |
getShowGrid()
Get whether the grid is displayed. |
boolean |
getSnapToGrid()
Get whether snap-to-grid is enabled. |
Texture |
getTexture(int i)
Get the i'th texture. |
Texture |
getTexture(java.lang.String name)
Get the texture with the specified name, or null if there is none. |
double |
getTime()
Get the current time. |
int |
indexOf(ImageMap im)
Get the index of the specified image map. |
int |
indexOf(Material mat)
Get the index of the specified material. |
int |
indexOf(ObjectInfo info)
Get the index of the specified object. |
int |
indexOf(Texture tex)
Get the index of the specified texture. |
void |
objectModified(Object3D obj)
This should be called whenever an object changes. |
void |
removeFromSelection(int which)
Deprecated. Call removeFromSelection() on the LayoutWindow instead. |
boolean |
removeImage(int which)
Remove an image map from the scene. |
void |
removeMaterial(int which)
Remove a Material from the scene. |
void |
removeMaterialListener(ListChangeListener ls)
Remove an object from the set to be notified when the list of Materials changes. |
void |
removeObject(int which,
UndoRecord undo)
Delete an object from the scene. |
void |
removeTexture(int which)
Remove a Texture from the scene. |
void |
removeTextureListener(ListChangeListener ls)
Remove an object from the set to be notified when the list of Textures changes. |
void |
reorderMaterial(int oldIndex,
int newIndex)
Reorder the list of Materials by moving a Material to a new position in the list. |
void |
reorderTexture(int oldIndex,
int newIndex)
Reorder the list of Textures by moving a Texture to a new position in the list. |
void |
replaceObject(Object3D original,
Object3D replaceWith,
UndoRecord undo)
Replace every instance of one object in the scene with another one. |
void |
setAmbientColor(RGBColor color)
Set the scene's ambient light color. |
void |
setDirectory(java.lang.String newDir)
Set the directory on disk in which this scene is saved. |
void |
setEnvironmentColor(RGBColor color)
Set the environment color. |
void |
setEnvironmentMapping(TextureMapping map)
Set the TextureMapping to use for mapping the environment map texture to the environment sphere. |
void |
setEnvironmentMode(int mode)
Set the Scene's environment mapping mode. |
void |
setEnvironmentParameterValues(ParameterValue[] value)
Set the parameter values used for the environment map. |
void |
setEnvironmentTexture(Texture tex)
Set the texture being used as an environment mapping. |
void |
setFog(boolean state,
double dist)
Set the state of fog in the scene. |
void |
setFogColor(RGBColor color)
Set the fog color. |
void |
setFramesPerSecond(int n)
Set the number of frames per second. |
void |
setGridSpacing(double spacing)
Set the grid spacing. |
void |
setGridSubdivisions(int subdivisions)
Set the number of grid snap-to subdivisions. |
void |
setMetadata(java.lang.String name,
java.lang.Object value)
Store a piece of metadata in this scene. |
void |
setName(java.lang.String newName)
Set the name of this scene. |
void |
setSelection(int which)
Deprecated. Call setSelection() on the LayoutWindow instead. |
void |
setSelection(int[] which)
Deprecated. Call setSelection() on the LayoutWindow instead. |
void |
setShowGrid(boolean show)
Set whether the grid is displayed. |
void |
setSnapToGrid(boolean snap)
Set whether snap-to-grid is enabled. |
void |
setTime(double t)
Set the current time. |
void |
showTexturesDialog(EditingWindow parent)
Show the dialog for editing textures and materials. |
void |
writeToFile(java.io.File f)
Save the Scene to a file. |
void |
writeToStream(java.io.DataOutputStream out)
Write the Scene's representation to an output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int HANDLE_SIZE
public static final int ENVIRON_SOLID
public static final int ENVIRON_DIFFUSE
public static final int ENVIRON_EMISSIVE
Constructor Detail |
---|
public Scene()
public Scene(java.io.File f, boolean fullScene) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
public Scene(java.io.DataInputStream in, boolean fullScene) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String newName)
public java.lang.String getDirectory()
public void setDirectory(java.lang.String newDir)
public double getTime()
public void setTime(double t)
public void applyTracksToObject(ObjectInfo info)
public void applyTracksAfterModification(java.util.Collection<ObjectInfo> changedObjects)
public int getFramesPerSecond()
public void setFramesPerSecond(int n)
public RGBColor getAmbientColor()
public void setAmbientColor(RGBColor color)
public int getEnvironmentMode()
public void setEnvironmentMode(int mode)
public Texture getEnvironmentTexture()
public void setEnvironmentTexture(Texture tex)
public TextureMapping getEnvironmentMapping()
public void setEnvironmentMapping(TextureMapping map)
public ParameterValue[] getEnvironmentParameterValues()
public void setEnvironmentParameterValues(ParameterValue[] value)
public RGBColor getEnvironmentColor()
public void setEnvironmentColor(RGBColor color)
public RGBColor getFogColor()
public void setFogColor(RGBColor color)
public boolean getFogState()
public double getFogDistance()
public void setFog(boolean state, double dist)
state
- sets whether fog is enableddist
- the length constant for exponential fog.public boolean getShowGrid()
public void setShowGrid(boolean show)
public boolean getSnapToGrid()
public void setSnapToGrid(boolean snap)
public double getGridSpacing()
public void setGridSpacing(double spacing)
public int getGridSubdivisions()
public void setGridSubdivisions(int subdivisions)
public void addObject(Object3D obj, CoordinateSystem coords, java.lang.String name, UndoRecord undo)
public void addObject(ObjectInfo info, UndoRecord undo)
public void addObject(ObjectInfo info, int index, UndoRecord undo)
public void removeObject(int which, UndoRecord undo)
public void addMaterial(Material mat)
public void addMaterial(Material mat, int index)
mat
- the Material to addindex
- the position in the list to add it atpublic void removeMaterial(int which)
public void reorderMaterial(int oldIndex, int newIndex)
oldIndex
- the index of the Material to movenewIndex
- the new position to move it topublic void addTexture(Texture tex)
public void addTexture(Texture tex, int index)
tex
- the Texture to addindex
- the position in the list to add it atpublic void removeTexture(int which)
public void reorderTexture(int oldIndex, int newIndex)
oldIndex
- the index of the Texture to movenewIndex
- the new position to move it topublic void changeMaterial(int which)
public void changeTexture(int which)
public void addMaterialListener(ListChangeListener ls)
public void removeMaterialListener(ListChangeListener ls)
public void addTextureListener(ListChangeListener ls)
public void removeTextureListener(ListChangeListener ls)
public java.lang.Object getMetadata(java.lang.String name)
name
- the name of the piece of metadata to get
public void setMetadata(java.lang.String name, java.lang.Object value)
name
- the name of the piece of metadata to setvalue
- the value to storepublic java.util.Set<java.lang.String> getAllMetadataNames()
public void showTexturesDialog(EditingWindow parent)
public void addImage(ImageMap im)
public boolean removeImage(int which)
public void replaceObject(Object3D original, Object3D replaceWith, UndoRecord undo)
public void objectModified(Object3D obj)
public void setSelection(int which)
public void setSelection(int[] which)
public void addToSelection(int which)
public void clearSelection()
public void removeFromSelection(int which)
public int getNumObjects()
public ObjectInfo getObject(int i)
public ObjectInfo getObject(java.lang.String name)
public ObjectInfo getObjectById(int id)
public java.util.List<ObjectInfo> getAllObjects()
public int indexOf(ObjectInfo info)
public int getNumTextures()
public int indexOf(Texture tex)
public Texture getTexture(int i)
public Texture getTexture(java.lang.String name)
public int getNumMaterials()
public Material getMaterial(int i)
public Material getMaterial(java.lang.String name)
public int indexOf(Material mat)
public int getNumImages()
public ImageMap getImage(int i)
public int indexOf(ImageMap im)
public Texture getDefaultTexture()
public int[] getSelection()
public int[] getSelectionWithChildren()
public boolean errorsOccurredInLoading()
public java.lang.String getLoadingErrors()
public void writeToFile(java.io.File f) throws java.io.IOException
java.io.IOException
public void writeToStream(java.io.DataOutputStream out) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |