|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SceneNode
Abstract node of (hierarchical) 3D scene representation.
CSGNode
,
CSGLeaf
Field Summary | |
---|---|
static java.lang.String |
ATTR_BSSRDF
Key for light-model attribute ( BSSRDF ). |
static java.lang.String |
ATTR_COLOR
Key for color attribute ( double[] ). |
static java.lang.String |
ATTR_TEXTURE
Key for texture attribute ( Texture or List<Texture >). |
Method Summary | |
---|---|
java.lang.Object |
getAttribute(java.lang.String key)
Returns the given attribute (defined in this SceneNode or inherited from
some parent node). |
java.util.List<java.lang.Object> |
getAttributes(java.lang.String key)
Returns the whole inherence-sequence for the given attribute. |
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 |
getOrder()
Returns order of this SceneNode in its parent. |
SceneNode |
getParent()
Returns the parent of this SceneNode . |
int |
getSerial()
Sets serial number of the current test. |
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 this sub-scene. |
boolean |
isObjectRoot()
Returns true if this node is root of object (component) hierarchy. |
int |
removeChild(int i)
Removes the given child node. |
boolean |
selfAttribute(java.lang.String key)
Is the given attribute defined in the SceneNode itself or is it inherited? |
java.lang.Object |
setAttribute(java.lang.String key,
java.lang.Object value)
Defines the given attribute (key-value pair) in the SceneNode . |
void |
setObjectRoot(boolean root)
Sets this node as root for the object (component). |
void |
setOrder(int ord)
Sets order of this SceneNode in its parent. |
void |
setParent(SceneNode par)
Sets handle to the parent node. |
void |
setSerial(int serial)
Returns serial number assigned to the node. |
Methods inherited from interface cz.cuni.jagrlib.IntersectionAttributes |
---|
assertAttributes |
Field Detail |
---|
static final java.lang.String ATTR_COLOR
double[]
).
static final java.lang.String ATTR_TEXTURE
Texture
or List<Texture
>).
static final java.lang.String ATTR_BSSRDF
BSSRDF
).
Method Detail |
---|
java.lang.Object getAttribute(java.lang.String key)
SceneNode
or inherited from
some parent node).
Returned object can be an original data object and must not be altered
outside this SceneNode
instance.
key
- Key-string.
null
. Must not be altered!getAttributes(java.lang.String)
,
setAttribute(java.lang.String, java.lang.Object)
,
selfAttribute(java.lang.String)
boolean selfAttribute(java.lang.String key)
SceneNode
itself or is it inherited?
key
- Key-string.
true
if the node defines the given attribute.getAttribute(java.lang.String)
,
setAttribute(java.lang.String, java.lang.Object)
,
getAttributes(java.lang.String)
java.lang.Object setAttribute(java.lang.String key, java.lang.Object value)
SceneNode
.
key
- Key-string.value
- Attribute value (arbitrary type).
SceneNode
itself!) or
null
.getAttribute(java.lang.String)
,
selfAttribute(java.lang.String)
,
getAttributes(java.lang.String)
java.util.List<java.lang.Object> getAttributes(java.lang.String key)
key
- Key-string.
result[0]
.. definition in the node itself,
result[1]
.. definition in parent node,
result[2]
.. definition in "grand-parent" node, etc.getAttribute(java.lang.String)
,
setAttribute(java.lang.String, java.lang.Object)
,
selfAttribute(java.lang.String)
int children()
0
for leaf SceneNode
).getChild(int)
,
getChildMatrix(int)
SceneNode getChild(int i)
i
- Order of the requested node (from 0
to children()
-1).
SceneNode
or null
.children()
,
getChildMatrix(int)
,
getChildMatrixInv(int)
TrMatrix getChildMatrix(int i)
i
- Order of the child node.
null
stands for identity.children()
,
getChild(int)
,
getChildMatrixInv(int)
TrMatrix getChildMatrixInv(int i)
i
- Order of the child node.
null
stands for identity.children()
,
getChild(int)
,
getChildMatrix(int)
int insertChild(SceneNode child, TrMatrix m, TrMatrix mInv)
child
- The new child SceneNode
.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()
int removeChild(int i)
i
- Order of the child node to be removed.
insertChild(cz.cuni.jagrlib.SceneNode, cz.cuni.jagrlib.TrMatrix, cz.cuni.jagrlib.TrMatrix)
,
children()
SceneNode getParent()
SceneNode
.
null
for scene-root.setParent(cz.cuni.jagrlib.SceneNode)
,
getOrder()
,
children()
,
getChild(int)
void setParent(SceneNode par)
par
- Parent node (or null
).getParent()
int getOrder()
SceneNode
in its parent.
-1
for scene-root).setOrder(int)
,
getParent()
void setOrder(int ord)
SceneNode
in its parent.
ord
- The new order.getOrder()
boolean isObjectRoot()
true
if this node is root of object (component) hierarchy.
setObjectRoot(boolean)
void setObjectRoot(boolean root)
root
- Should this node be treated as root?isObjectRoot()
int getSerial()
void setSerial(int serial)
java.util.List<MicroFacet> intersection(double[] P0, double[] P1)
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 |