- All Known Implementing Classes:
SceneVisitor
public interface Scene
A
Scene
represents the complete geometry, shading,
and lighting information which is needed for a raytracer. In addition,
it defines the sensors within the scene for a radiation model.
Note that
the methods are not thread-safe: For each additional thread,
its own instance of Scene
has to be created from the
original instance via the method dup()
.
- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendStatistics
(StringBuffer stats) Appends some statistics information about the scene tostats
.boolean
computeIntersections
(Line line, int which, IntersectionList list, Intersection excludeStart, Intersection excludeEnd) Computes intersections between the boundary surface of the objects of the scene and the specifiedline
.This factory method creates a new spectrum which shall be used for light computations within the context of this scene.dup()
Returns a clone of thisScene
.Returns a bounding box which contains all finite geometric objects of the scene.getGraph()
Returns an object identifying the underlying scene graph.Returns the interior which is associated with volumev
.getInverseLightTransformation
(int light) Returns the affine light transformation from global world coordinates to local light coordinates for the light having indexlight
ingetLights()
.getInverseSensorTransformation
(int sensor) Returns the affine sensor transformation from global world coordinates to local sensor coordinates for the sensor having indexsensor
ingetSensors()
.int
Returns the index ingetLights()
of the light which is associated with volumev
, or-1
if no such light exists.Light[]
Returns an array of all lights in the scene.getLightTransformation
(int light) Returns the affine light transformation from local light coordinates to global world coordinates for the light having indexlight
ingetLights()
.int
Returns the index ingetSensors()
of the sensor which is associated with volumev
, or-1
if no such sensor exists.Sensor[]
Returns an array of all sensors in the scene.getSensorTransformation
(int sensor) Returns the affine sensor transformation from local sensor coordinates to global world coordinates for the sensor having indexsensor
ingetSensors()
.Returns the shader which is associated with volumev
.int
getStamp()
Returns a modification stamp for the underlying scene graph.Returns a unique name for the current scene, so that the test whether two scenes are identical can be performed.void
Transforms a point in global world coordinates to local object coordinates of the volumev
.
-
Method Details
-
dup
Scene dup()Returns a clone of thisScene
. All constant variables which are related to the structure of the scene are copied shallowly, state variables are newly created without copying.- Returns:
- clone of this scene
-
computeIntersections
boolean computeIntersections(Line line, int which, IntersectionList list, Intersection excludeStart, Intersection excludeEnd) Computes intersections between the boundary surface of the objects of the scene and the specifiedline
. For the precise behaviour and the meaning of the parameters, seeVolume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection)
.- Parameters:
line
- a linewhich
- one ofIntersection.ALL
,Intersection.CLOSEST
,Intersection.ANY
, this determines which intersections have to be added tolist
list
- the intersections are added to this listexcludeStart
- intersection at start point which shall be excluded, ornull
excludeEnd
- intersection at end point which shall be excluded, ornull
- Returns:
true
iff the beginning of the line lies within the volume (i.e., if the line starts within the volume or enters the volume at the starting point); however note that the returned value is valid only ifwhich == Intersection.ALL
- See Also:
-
getBoundingBox
BoundingBox getBoundingBox()Returns a bounding box which contains all finite geometric objects of the scene. The returned box must not be modified.- Returns:
- bounding box of finite geometry
-
getShader
Returns the shader which is associated with volumev
.- Parameters:
v
- a volume- Returns:
- corresponding shader
-
getInterior
Returns the interior which is associated with volumev
.- Parameters:
v
- a volume- Returns:
- corresponding interior
-
getLight
Returns the index ingetLights()
of the light which is associated with volumev
, or-1
if no such light exists.- Parameters:
v
- a volume- Returns:
- index of corresponding light in
getLights()
-
getSensor
Returns the index ingetSensors()
of the sensor which is associated with volumev
, or-1
if no such sensor exists.- Parameters:
v
- a volume- Returns:
- index of corresponding sensor in
getSensors()
-
transform
Transforms a point in global world coordinates to local object coordinates of the volumev
.- Parameters:
v
- volume which defines the local object coordinatesglobal
- input point in global world coordinateslocalOut
- output point in local object coordinates
-
getLights
Light[] getLights()Returns an array of all lights in the scene. The returned array must not be modified. The corresponding coordinate transformations are obtained bygetLightTransformation(int)
.- Returns:
- array of all lights
-
getLightTransformation
Returns the affine light transformation from local light coordinates to global world coordinates for the light having indexlight
ingetLights()
.- Parameters:
light
- index of light ingetLights()
- Returns:
- light transformation for
light
- See Also:
-
getInverseLightTransformation
Returns the affine light transformation from global world coordinates to local light coordinates for the light having indexlight
ingetLights()
.- Parameters:
light
- index of light ingetLights()
- Returns:
- inverse light transformation for
light
- See Also:
-
getSensors
Sensor[] getSensors()Returns an array of all sensors in the scene. The returned array must not be modified. The corresponding coordinate transformations are obtained bygetSensorTransformation(int)
.- Returns:
- array of all sensors
-
getSensorTransformation
Returns the affine sensor transformation from local sensor coordinates to global world coordinates for the sensor having indexsensor
ingetSensors()
.- Parameters:
sensor
- index of sensor ingetSensors()
- Returns:
- sensor transformation for
sensor
- See Also:
-
getInverseSensorTransformation
Returns the affine sensor transformation from global world coordinates to local sensor coordinates for the sensor having indexsensor
ingetSensors()
.- Parameters:
sensor
- index of sensor ingetSensors()
- Returns:
- inverse sensor transformation for
sensor
- See Also:
-
getStamp
int getStamp()Returns a modification stamp for the underlying scene graph. Each modification increments the value, so that the test whether some modification occured can be simply performed on values of the stamp.- Returns:
- a stamp for the whole graph
-
getUniqueName
String getUniqueName()Returns a unique name for the current scene, so that the test whether two scenes are identical can be performed. -
getGraph
Object getGraph()Returns an object identifying the underlying scene graph.- Returns:
- scene graph
-
createSpectrum
Spectrum createSpectrum()This factory method creates a new spectrum which shall be used for light computations within the context of this scene.- Returns:
- new spectrum instance for use in computations
-
appendStatistics
Appends some statistics information about the scene tostats
.- Parameters:
stats
- buffer for statistics information
-
getOctree
OctreeUnion getOctree()
-