|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.StaticCSGScene
public class StaticCSGScene
CSG representation of 3D scenes for Ray-tracing rendering methods. Static scene object (no time-variable is implemented).
Field Summary | |
---|---|
protected double[] |
background
Actual background color. |
protected RayGenerator |
camera
Static camera. |
protected static java.lang.String |
CATEGORY
Object category. |
protected boolean |
dirty
Does scene object need to be read from JGL script? |
protected java.lang.String |
fileName
Scene definition: JGL script file name. |
static java.lang.String |
KEY_BACKGROUND
JGL script key: background. |
static java.lang.String |
KEY_BREP
JGL script key: Brep scene. |
static java.lang.String |
KEY_CAMERA
JGL script key: camera. |
static java.lang.String |
KEY_LIGHTS
JGL script key: lights. |
static java.lang.String |
KEY_OBJ
JGL script key: OBJ import filter scene. |
static java.lang.String |
KEY_SCENE
JGL script key: CSG scene. |
protected LightSource[] |
lights
Static array of light sources in the scene. |
protected int |
nextId
Next assigned object id#. |
static RegPiece |
reg
Static registration instance for this class. |
protected SceneNode |
root
Root node of the CSG-tree. |
static java.lang.String |
SCENE
|
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
StaticCSGScene()
|
Method Summary | |
---|---|
protected void |
assertScene()
All scene components have be usable. |
protected void |
defaultBackground()
Initializes default background color. |
protected void |
defaultCamera()
Sets default camera. |
protected void |
defaultLights()
Sets default light sources (one point and one ambient). |
protected void |
defaultScene()
Initializes CSG scene to the default state (4 ellipsoids). |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
double[] |
getBackground()
Retrieves background color (used when a ray doesn't hit anything). |
RayGenerator |
getCamera()
Retrieves the actual camera (ray-generator). |
LightSource[] |
getLights()
Retrieves all light sources from the scene. |
LightSource[] |
getLightsToMicroFacet(MicroFacet mf,
int order,
int total)
Retrieves light sources which light up the given micro-facet. |
double |
getTime()
Returns the actual time value for the scene (used in animations). |
double[] |
getTimeInterval(double[] pre)
Retrieve the valid bounds for time variable. |
MicroFacet |
intersection(double[] P0,
double[] P1)
Computes the nearest intersection of the given ray with scene surface. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
void |
setCamera(RayGenerator camera)
Sets the camera object (ray-generator) for the scene. |
void |
setLights(LightSource[] l)
Sets all the light sources from the given array. |
void |
setRoot(SceneNode root)
Sets root node (assumes hierarchical scene representation based on SceneNode ). |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
void |
setTime(double time)
Sets the actual time value for the scene (used in animations). |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
public static final java.lang.String KEY_SCENE
public static final java.lang.String KEY_CAMERA
public static final java.lang.String KEY_LIGHTS
public static final java.lang.String KEY_BACKGROUND
public static final java.lang.String KEY_BREP
public static final java.lang.String KEY_OBJ
protected java.lang.String fileName
protected boolean dirty
protected SceneNode root
protected RayGenerator camera
protected LightSource[] lights
protected double[] background
protected int nextId
public static final java.lang.String SCENE
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public StaticCSGScene()
Method Detail |
---|
protected void defaultLights()
protected void defaultCamera()
protected void defaultScene()
protected void defaultBackground()
protected void assertScene()
public MicroFacet intersection(double[] P0, double[] P1)
intersection
in interface Intersectable
P0
- Ray origin (double[3]
or double[4]
).P1
- Direction vector of the ray (double[3]
or double[4]
).
null
.MicroFacet
public double[] getTimeInterval(double[] pre)
getTimeInterval
in interface TimeDependent
pre
- Pre-allocated double[2]
array to hold the result (can be
null
).
result[0]
.. minimum time value, result[1]
.. maximum
time value.getTime()
,
setTime(double)
public double getTime()
getTime
in interface TimeDependent
setTime(double)
public void setTime(double time)
setTime
in interface TimeDependent
time
- New scene time (in seconds).getTime()
,
getTimeInterval(double[])
public void setRoot(SceneNode root)
SceneNode
).
setRoot
in interface RTScene
public void setCamera(RayGenerator camera)
setCamera
in interface RTScene
public RayGenerator getCamera()
getCamera
in interface RTScene
RayGenerator
object.public void setLights(LightSource[] l)
setLights
in interface RTScene
public LightSource[] getLights()
getLights
in interface RTScene
getLightsToMicroFacet(cz.cuni.jagrlib.MicroFacet, int, int)
public LightSource[] getLightsToMicroFacet(MicroFacet mf, int order, int total)
getLightsToMicroFacet
in interface RTScene
mf
- Micro-facet which is to be lighted.order
- Order of this sample inside the actual pixel.total
- Total number of samples in the actual pixel.
null
marks end of data).getLights()
public double[] getBackground()
getBackground
in interface RTScene
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |