|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultSceneNode
cz.cuni.jagrlib.CSGCommonNode
cz.cuni.jagrlib.CSGNode
public class CSGNode
Inner node of CSG scene representation.
CSGLeaf
Nested Class Summary | |
---|---|
protected static class |
CSGNode.Child
|
Field Summary | |
---|---|
protected java.util.ArrayList<CSGNode.Child> |
ch
Array of child-references. |
int |
op
Set operation code. |
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 | |
---|---|
CSGNode(int _op)
Initializing constructor. |
Method Summary | |
---|---|
SceneNode |
getChild(int i)
Returns the given child node. |
TrMatrix |
getChildMatrix(int i)
Returns transformation matrix for the given child node. |
TrMatrix |
getChildMatrixInv(int i)
Returns inverse transformation matrix for the given child node. |
int |
children()
Returns number of child nodes. |
int |
insertChild(SceneNode child,
TrMatrix m,
TrMatrix mInv)
Inserts a new child node. |
java.util.List<MicroFacet> |
intersection(double[] P0,
double[] P1)
Computes all intersections of the given ray with sub-scene surface. |
protected java.util.List<MicroFacet> |
intersection(double[] P0,
double[] P1,
int i)
Computes all intersections of the given ray with one child scene. |
int |
removeChild(int i)
Removes the given child node. |
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 |
---|
getSerial, setSerial |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int op
BinaryOperation
protected java.util.ArrayList<CSGNode.Child> ch
Constructor Detail |
---|
public CSGNode(int _op)
Method Detail |
---|
public final int children()
children
in interface SceneNode
children
in class DefaultSceneNode
0
for leaf node).getChild(int)
,
getChildMatrix(int)
,
getChildMatrixInv(int)
public SceneNode getChild(int i)
getChild
in interface SceneNode
getChild
in class DefaultSceneNode
i
- Order of the requested node (from 0
to children()-1
).
null
.children()
,
getChildMatrix(int)
,
getChildMatrixInv(int)
public TrMatrix getChildMatrix(int i)
getChildMatrix
in interface SceneNode
getChildMatrix
in class DefaultSceneNode
i
- Order of the child node.
null
stands for identity.children()
,
getChild(int)
,
getChildMatrixInv(int)
public TrMatrix getChildMatrixInv(int i)
getChildMatrixInv
in interface SceneNode
getChildMatrixInv
in class DefaultSceneNode
i
- Order of the child node.
null
stands for identity.children()
,
getChild(int)
,
getChildMatrix(int)
public int insertChild(SceneNode child, TrMatrix m, TrMatrix mInv)
insertChild
in interface SceneNode
insertChild
in class DefaultSceneNode
child
- The new child node.m
- Transformation matrix for the new child node (transformation from child's
coordinate system to this node's one). Can be null
, even
for non-trivial mInv
.mInv
- Inverse transformation matrix for the new child node (transformation from
this node's coordinate system to child's one). Can be null
, even
for non-trivial m
.
-1
in case of failure).removeChild(int)
,
children()
public int removeChild(int i)
removeChild
in interface SceneNode
removeChild
in class DefaultSceneNode
i
- Order of the child node to be removed.
insertChild(cz.cuni.jagrlib.SceneNode, cz.cuni.jagrlib.TrMatrix, cz.cuni.jagrlib.TrMatrix)
,
children()
protected java.util.List<MicroFacet> intersection(double[] P0, double[] P1, int i)
P0
- Ray origin (double[3]
).P1
- Direction vector of the ray (double[3]
).i
- Order of the child node.
public java.util.List<MicroFacet> intersection(double[] P0, double[] P1)
intersection
in interface SceneNode
intersection
in class DefaultSceneNode
P0
- Ray origin (double[3]
or double[4]
).P1
- Direction vector of the ray (double[3]
or double[4]
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |