Module rgg
Package de.grogra.rgg

Class LightModelD

All Implemented Interfaces:
VolumeListener, Manageable, Shareable, Options

public class LightModelD extends LightModel implements Options, VolumeListener
Provides the same functionality as LightModelD but in addition can deliver results for every recursion depth.
Author:
MH
  • Field Details

  • Constructor Details

    • LightModelD

      public LightModelD()
      Create a default light model with 30.000 rays per computation and a ray depth of 10.
    • LightModelD

      public LightModelD(int rayCount, int depth)
    • LightModelD

      public LightModelD(int rayCount, int depth, double minPower)
  • Method Details

    • compute

      public void compute(Spectrum spectrumFactory, boolean force, boolean collectTracedRays)
      (Re-)computes the light distribution in the current graph. This method has to be invoked at first in order for LightModelBase.getRadiantPowerFor(de.grogra.graph.impl.Node) to return correct values.
      Overrides:
      compute in class LightModel
      Parameters:
      force - if true forces recomputation of the light distribution
      collectTracedRays - if true the traced rays are collected and can be obtained by {}. This can be used for debugging purposes.
    • checkVolumeId

      protected int checkVolumeId(Node node)
      Overrides:
      checkVolumeId in class LightModel
    • getHitCount

      public int getHitCount(Node node)
      Returns the number of rays which is hit the surface of the volume of the given node. If the node does not define a volume, the zero is returned.
      Overrides:
      getHitCount in class LightModel
      Parameters:
      node - a node of the graph
      Returns:
      the number of rays which is hit the node
    • getTransmittedPower

      public Spectrum getTransmittedPower(Node node)
      Returns the radiant power in Watts which is transmitted by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Overrides:
      getTransmittedPower in class LightModel
      Parameters:
      node - a node of the graph
      Returns:
      the transmitted radiant power of the node
    • getReflectedPower

      public Spectrum getReflectedPower(Node node)
      Returns the radiant power in Watts which is reflected by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Overrides:
      getReflectedPower in class LightModel
      Parameters:
      node - a node of the graph
      Returns:
      the reflected radiant power of the node
    • getReceivedPower

      public Spectrum getReceivedPower(Node node)
      Returns the radiant power in Watts which is received by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Overrides:
      getReceivedPower in class LightModel
      Parameters:
      node - a node of the graph
      Returns:
      the received radiant power of the node
    • getAbsorbedPower

      public Spectrum getAbsorbedPower(Node node)
      Returns the radiant power in Watts which is absorbed by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Overrides:
      getAbsorbedPower in class LightModel
      Parameters:
      node - a node of the graph
      Returns:
      the absorbed radiant power of the node
    • getSensedIrradiance

      public Spectrum getSensedIrradiance(Node node)
      Returns the irradiance in Watts per square meter which is sensed by the sensor attached to the volume of the given node. If the node does not define a volume with a sensor, the zero spectrum is returned.
      Overrides:
      getSensedIrradiance in class LightModel
      Parameters:
      node - a node of the graph
      Returns:
      the sensed irradiance of the node
    • getHitCount

      public int getHitCount(Node node, int idx)
      Returns the number of rays which is hit the surface of the volume of the given node. If the node does not define a volume, the zero is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the number of rays which is hit the node
    • getTransmittedPower

      public Spectrum getTransmittedPower(Node node, int idx)
      Returns the radiant power in Watts which is transmitted by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the transmitted radiant power of the node
    • getReflectedPower

      public Spectrum getReflectedPower(Node node, int idx)
      Returns the radiant power in Watts which is reflected by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the reflected radiant power of the node
    • getReceivedPower

      public Spectrum getReceivedPower(Node node, int idx)
      Returns the radiant power in Watts which is received by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the received radiant power of the node
    • getAbsorbedPower

      public Spectrum getAbsorbedPower(Node node, int idx)
      Returns the radiant power in Watts which is absorbed by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the absorbed radiant power of the node
    • getSensedIrradiance

      public Spectrum getSensedIrradiance(Node node, int idx)
      Returns the irradiance in Watts per square meter which is sensed by the sensor attached to the volume of the given node. If the node does not define a volume with a sensor, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the sensed irradiance of the node
    • getHitCountD

      public int[] getHitCountD(Node node)
      Returns the number of rays which is hit the surface of the volume of the given node. If the node does not define a volume, the zero is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the number of rays which is hit the node
    • getTransmittedPowerD

      public Spectrum[] getTransmittedPowerD(Node node)
      Returns the radiant power in Watts which is transmitted by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the transmitted radiant power of the node
    • getReflectedPowerD

      public Spectrum[] getReflectedPowerD(Node node)
      Returns the radiant power in Watts which is reflected by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the reflected radiant power of the node
    • getReceivedPowerD

      public Spectrum[] getReceivedPowerD(Node node)
      Returns the radiant power in Watts which is received by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the received radiant power of the node
    • getAbsorbedPowerD

      public Spectrum[] getAbsorbedPowerD(Node node)
      Returns the radiant power in Watts which is absorbed by the surface of the volume of the given node. If the node does not define a volume, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the absorbed radiant power of the node
    • getSensedIrradianceD

      public Spectrum[] getSensedIrradianceD(Node node)
      Returns the irradiance in Watts per square meter which is sensed by the sensor attached to the volume of the given node. If the node does not define a volume with a sensor, the zero spectrum is returned.
      Parameters:
      node - a node of the graph
      Returns:
      the sensed irradiance of the node
    • getSensedIrradianceCollector

      public Collector getSensedIrradianceCollector(Node node)
      Overrides:
      getSensedIrradianceCollector in class LightModel
    • getAbsorbedPowerCollector

      public Collector getAbsorbedPowerCollector(Node node)
      Overrides:
      getAbsorbedPowerCollector in class LightModel
    • volumeCreated

      public void volumeCreated(Object object, boolean asNode, Volume volume)
      Description copied from interface: VolumeListener
      This method is invoked by a SceneVisitor when a volume is created as representation of the geometry of object. By storing the information provided by the parameters, the link from graph objects (nodes and edges) to volumes can be established.
      Specified by:
      volumeCreated in interface VolumeListener
      Overrides:
      volumeCreated in class LightModel
      Parameters:
      object - an object of the graph
      asNode - is object a node or an edge?
      volume - the volume which has been created as geometrical representation of object
    • beginGroup

      public void beginGroup(Object object, boolean asNode)
      Description copied from interface: VolumeListener
      This method is invoked by a SceneVisitor when subsequent volumes shall be grouped into a single compound object. The group extends until the corresponding invocation of VolumeListener.endGroup(). These invocations may be nested, i.e., there may be groups within groups.

      Each group starts at object in the graph. If object has a geometric representation itself, the corresponding invocation of VolumeListener.volumeCreated(java.lang.Object, boolean, de.grogra.vecmath.geom.Volume) may be either immediately before of after beginGroup.

      Specified by:
      beginGroup in interface VolumeListener
      Overrides:
      beginGroup in class LightModel
      Parameters:
      object - the object of the graph which represents the root of the group
      asNode - is object a node or an edge?
      See Also:
    • endGroup

      public void endGroup()
      Description copied from interface: VolumeListener
      This method is invoked by a SceneVisitor when the current group ends.
      Specified by:
      endGroup in interface VolumeListener
      Overrides:
      endGroup in class LightModel
      See Also:
    • getManageableType

      public ManageableType getManageableType()
      Specified by:
      getManageableType in interface Manageable
      Overrides:
      getManageableType in class LightModel