|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.grogra.persistence.ShareableBase
de.grogra.rgg.LightModelBase
de.grogra.rgg.LightModel
public class LightModel
This light model generates light rays from the light sources in the current
scene and calculates how much light is received by any object. This
basically works like an inverse ray tracer.
The total light contribution of the light source to the scene determines
how many rays are created for that light source. For instance if there were
two light sources with a power of 100W and 10W and a total number of 11.000
rays, then the first light would create 10.000 rays and the second light
1.000 rays.
Nested Class Summary | |
---|---|
static class |
LightModel.Type
|
Field Summary | |
---|---|
static LightModel.Type |
$TYPE
|
static SCOType.Field |
depth$FIELD
|
static SCOType.Field |
minPower$FIELD
|
static SCOType.Field |
rayCount$FIELD
|
static SCOType.Field |
seed$FIELD
|
static SCOType.Field |
spectrumFactory$FIELD
|
static SCOType.Field |
threadCount$FIELD
|
static SCOType.Field |
visibleLayers$FIELD
|
Constructor Summary | |
---|---|
LightModel()
Create a default light model with 30.000 rays per computation and a ray depth of 10. |
|
LightModel(int rayCount,
int depth)
|
|
LightModel(int rayCount,
int depth,
double minPower)
|
Method Summary | |
---|---|
void |
beginGroup(java.lang.Object object,
boolean asNode)
This method is invoked by a SceneVisitor when subsequent
volumes shall be grouped into a single compound object. |
void |
compute()
(Re-)computes the light distribution in the current graph. |
void |
compute(boolean force)
(Re-)computes the light distribution in the current graph. |
void |
compute(Spectrum spectrumFactory)
(Re-)computes the light distribution in the current graph. |
void |
compute(Spectrum spectrumFactory,
boolean force)
(Re-)computes the light distribution in the current graph. |
void |
endGroup()
This method is invoked by a SceneVisitor when the current group
ends. |
java.lang.Object |
get(java.lang.String key,
java.lang.Object defaultValue)
Returns the option value for the option identified by key . |
Spectrum |
getAbsorbedPower(Node node)
Returns the radiant power in Watts which is absorbed by the surface of the volume of the given node . |
Collector |
getAbsorbedPowerCollector(Node node)
|
int |
getDepth()
|
ManageableType |
getManageableType()
|
double |
getMinPower()
|
int |
getRayCount()
|
long |
getSeed()
|
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 . |
Collector |
getSensedIrradianceCollector(Node node)
|
Spectrum |
getSpectrumFactory()
|
int |
getThreadCount()
|
void |
invalidateOctree()
This invalidates the octree of the SceneVisitor and forces a complete new computation. |
void |
setDepth(int depth)
|
void |
setLayerVisible(int layer,
boolean visible)
sets the visibility of a layer |
void |
setMinPower(double minPower)
|
void |
setRayCount(int rayCount)
|
void |
setSeed(long value)
|
void |
setSpectrumFactory(Spectrum value)
|
void |
setThreadCount(int value)
|
void |
volumeCreated(java.lang.Object object,
boolean asNode,
Volume volume)
This method is invoked by a SceneVisitor when a
volume is created as representation of the geometry
of object . |
Methods inherited from class de.grogra.rgg.LightModelBase |
---|
getAbsorbedPower3d, getRadiantPower3dFor, getRadiantPowerFor, getSensedIrradiance3d |
Methods inherited from class de.grogra.persistence.ShareableBase |
---|
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final LightModel.Type $TYPE
public static final SCOType.Field depth$FIELD
public static final SCOType.Field minPower$FIELD
public static final SCOType.Field rayCount$FIELD
public static final SCOType.Field seed$FIELD
public static final SCOType.Field spectrumFactory$FIELD
public static final SCOType.Field threadCount$FIELD
public static final SCOType.Field visibleLayers$FIELD
Constructor Detail |
---|
public LightModel()
public LightModel(int rayCount, int depth)
public LightModel(int rayCount, int depth, double minPower)
Method Detail |
---|
public void beginGroup(java.lang.Object object, boolean asNode)
VolumeListener
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
.
beginGroup
in interface VolumeListener
object
- the object of the graph which represents the root
of the groupasNode
- is object
a node or an edge?VolumeListener.endGroup()
public void compute()
LightModelBase
compute
in class LightModelBase
public void compute(boolean force)
LightModelBase
compute
in class LightModelBase
force
- if true forces recomputation of the light distributionpublic void compute(Spectrum spectrumFactory)
LightModelBase
compute
in class LightModelBase
spectrumFactory
- factrory for spectrum objectspublic void compute(Spectrum spectrumFactory, boolean force)
LightModelBase.getRadiantPowerFor(de.grogra.graph.impl.Node)
to return correct values.
compute
in class LightModelBase
force
- if true forces recomputation of the light distributionspectrumFactory
- factrory for spectrum objectspublic void endGroup()
VolumeListener
SceneVisitor
when the current group
ends.
endGroup
in interface VolumeListener
VolumeListener.beginGroup(java.lang.Object, boolean)
public java.lang.Object get(java.lang.String key, java.lang.Object defaultValue)
Options
key
. If no special value for the option is defined,
defaultValue
is returned.
get
in interface Options
key
- identifier for optiondefaultValue
- default value of option
key
public Spectrum getAbsorbedPower(Node node)
node
. If the node
does not define a volume, the zero spectrum is returned.
getAbsorbedPower
in class LightModelBase
node
- a node of the graph
public Collector getAbsorbedPowerCollector(Node node)
public int getDepth()
public ManageableType getManageableType()
getManageableType
in interface Manageable
public double getMinPower()
public int getRayCount()
public long getSeed()
public Spectrum getSensedIrradiance(Node node)
node
.
If the node
does not define a volume with a sensor,
the zero spectrum is returned.
getSensedIrradiance
in class LightModelBase
node
- a node of the graph
public Collector getSensedIrradianceCollector(Node node)
public Spectrum getSpectrumFactory()
public int getThreadCount()
public void invalidateOctree()
public void setDepth(int depth)
public void setLayerVisible(int layer, boolean visible)
LightModelBase
setLayerVisible
in class LightModelBase
public void setMinPower(double minPower)
public void setRayCount(int rayCount)
public void setSeed(long value)
public void setSpectrumFactory(Spectrum value)
public void setThreadCount(int value)
public void volumeCreated(java.lang.Object object, boolean asNode, Volume volume)
VolumeListener
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.
volumeCreated
in interface VolumeListener
object
- an object of the graphasNode
- is object
a node or an edge?volume
- the volume which has been created as geometrical
representation of object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |