cz.cuni.jagrlib
Class CSGLeaf

java.lang.Object
  extended by cz.cuni.jagrlib.DefaultSceneNode
      extended by cz.cuni.jagrlib.CSGCommonNode
          extended by cz.cuni.jagrlib.CSGLeaf
All Implemented Interfaces:
IntersectionAttributes, SceneNode

public class CSGLeaf
extends CSGCommonNode

Leaf node (holding elementary solid) of CSG scene representation.

Since:
0.11
See Also:
CSGLeaf.java, Solid, CSGNode

Field Summary
 Solid solid
          Solid which is assigned to this leaf-node.
 
Fields inherited from class cz.cuni.jagrlib.CSGCommonNode
attr, order, parent, root
 
Fields inherited from class cz.cuni.jagrlib.DefaultSceneNode
serial
 
Fields inherited from interface cz.cuni.jagrlib.SceneNode
ATTR_BSSRDF, ATTR_COLOR, ATTR_TEXTURE
 
Constructor Summary
CSGLeaf(Solid _solid)
          Initializing constructor.
 
Method Summary
 java.util.List<MicroFacet> intersection(double[] P0, double[] P1)
          Computes all intersections of the given ray with the solid.
 
Methods inherited from class cz.cuni.jagrlib.CSGCommonNode
assertAttributes, getAttribute, getAttributes, getOrder, getParent, isObjectRoot, selfAttribute, setAttribute, setObjectRoot, setOrder, setParent
 
Methods inherited from class cz.cuni.jagrlib.DefaultSceneNode
getChild, getChildMatrix, getChildMatrixInv, getSerial, children, insertChild, removeChild, setSerial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

solid

public Solid solid
Solid which is assigned to this leaf-node. One Solid instance can be shared among multiple CSGLeafNodes.

Constructor Detail

CSGLeaf

public CSGLeaf(Solid _solid)
Initializing constructor.

Method Detail

intersection

public java.util.List<MicroFacet> intersection(double[] P0,
                                               double[] P1)
Computes all intersections of the given ray with the solid.

Specified by:
intersection in interface SceneNode
Overrides:
intersection in class DefaultSceneNode
Parameters:
P0 - Ray origin (double[3] or double[4]).
P1 - Direction vector of the ray (double[3] or double[4]).
Returns:
List of all intersections with the solid.