Module raytracer

Interface Scene

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 Details

    • dup

      Scene dup()
      Returns a clone of this Scene. 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 specified line. For the precise behaviour and the meaning of the parameters, see Volume.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 line
      which - one of Intersection.ALL, Intersection.CLOSEST, Intersection.ANY, this determines which intersections have to be added to list
      list - the intersections are added to this list
      excludeStart - intersection at start point which shall be excluded, or null
      excludeEnd - intersection at end point which shall be excluded, or null
      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 if which == 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

      Shader getShader(Volume v)
      Returns the shader which is associated with volume v.
      Parameters:
      v - a volume
      Returns:
      corresponding shader
    • getInterior

      Interior getInterior(Volume v)
      Returns the interior which is associated with volume v.
      Parameters:
      v - a volume
      Returns:
      corresponding interior
    • getLight

      int getLight(Volume v)
      Returns the index in getLights() of the light which is associated with volume v, or -1 if no such light exists.
      Parameters:
      v - a volume
      Returns:
      index of corresponding light in getLights()
    • getSensor

      int getSensor(Volume v)
      Returns the index in getSensors() of the sensor which is associated with volume v, or -1 if no such sensor exists.
      Parameters:
      v - a volume
      Returns:
      index of corresponding sensor in getSensors()
    • transform

      void transform(Volume v, Tuple3d global, Tuple3d localOut)
      Transforms a point in global world coordinates to local object coordinates of the volume v.
      Parameters:
      v - volume which defines the local object coordinates
      global - input point in global world coordinates
      localOut - 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 by getLightTransformation(int).
      Returns:
      array of all lights
    • getLightTransformation

      Matrix4d getLightTransformation(int light)
      Returns the affine light transformation from local light coordinates to global world coordinates for the light having index light in getLights().
      Parameters:
      light - index of light in getLights()
      Returns:
      light transformation for light
      See Also:
    • getInverseLightTransformation

      Matrix4d getInverseLightTransformation(int light)
      Returns the affine light transformation from global world coordinates to local light coordinates for the light having index light in getLights().
      Parameters:
      light - index of light in getLights()
      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 by getSensorTransformation(int).
      Returns:
      array of all sensors
    • getSensorTransformation

      Matrix4d getSensorTransformation(int sensor)
      Returns the affine sensor transformation from local sensor coordinates to global world coordinates for the sensor having index sensor in getSensors().
      Parameters:
      sensor - index of sensor in getSensors()
      Returns:
      sensor transformation for sensor
      See Also:
    • getInverseSensorTransformation

      Matrix4d getInverseSensorTransformation(int sensor)
      Returns the affine sensor transformation from global world coordinates to local sensor coordinates for the sensor having index sensor in getSensors().
      Parameters:
      sensor - index of sensor in getSensors()
      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

      void appendStatistics(StringBuffer stats)
      Appends some statistics information about the scene to stats.
      Parameters:
      stats - buffer for statistics information
    • getOctree

      OctreeUnion getOctree()