public class Node extends SceneObject
name, properties
Constructor and Description |
---|
Node()
Initializes a new instance of the
Node class. |
Node(java.lang.String name)
Initializes a new instance of the
Node class. |
Node(java.lang.String name,
Entity entity)
Initializes a new instance of the
Node class. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(NodeVisitor visitor)
Walks through all descendant nodes(including the current node) and call the visitor with the node.
|
void |
addChildNode(Node node)
Add a child node to this node
|
void |
addEntity(Entity entity)
Add an entity to the node.
|
Node |
createChildNode()
Creates a child node
|
Node |
createChildNode(Entity entity)
Create a new child node with given entity attached
|
Node |
createChildNode(java.lang.String nodeName)
Create a new child node with given node name
|
Node |
createChildNode(java.lang.String nodeName,
Entity entity)
Create a new child node with given node name
|
Node |
createChildNode(java.lang.String nodeName,
Entity entity,
Material material)
Create a new child node with given node name, and attach specified entity and a material
|
Matrix4 |
evaluateGlobalTransform(boolean withGeometricTransform)
Evaluate the global transform, include the geometric transform or not.
|
AssetInfo |
getAssetInfo()
Per-node asset info
|
BoundingBox |
getBoundingBox()
Calculate the bounding box of the node
|
Node |
getChild(int index)
Gets the child node at specified index.
|
Node |
getChild(java.lang.String nodeName)
Gets the child node with the specified name
|
java.util.List<Node> |
getChildNodes()
Gets the children nodes.
|
java.util.List<Entity> |
getEntities()
Gets all node entities.
|
Entity |
getEntity()
Gets the first entity attached to this node, if sets, will clear other entities.
|
boolean |
getExcluded()
Gets wheather to exclude this node and all child nodes/entities during exporting.
|
GlobalTransform |
getGlobalTransform()
Gets the global transform.
|
Material |
getMaterial()
Gets the first material associated with this node, if sets, will clear other materials
|
java.util.List<Material> |
getMaterials()
Gets the materials associated with this node.
|
java.util.List<CustomObject> |
getMetaDatas()
Gets the meta data defined in this node.
|
Node |
getParentNode()
Gets the parent node.
|
Transform |
getTransform()
Gets the local transform.
|
boolean |
getVisible()
Gets to show the node
|
java.util.ArrayList<java.lang.Object> |
selectObjects(java.lang.String path)
Select multiple objects under current node using XPath-like query syntax.
|
java.lang.Object |
selectSingleObject(java.lang.String path)
Select single object under current node using XPath-like query syntax.
|
void |
setAssetInfo(AssetInfo value)
Per-node asset info
|
void |
setEntity(Entity value)
Sets the first entity attached to this node, if sets, will clear other entities.
|
void |
setExcluded(boolean value)
Sets wheather to exclude this node and all child nodes/entities during exporting.
|
void |
setMaterial(Material value)
Sets the first material associated with this node, if sets, will clear other materials
|
void |
setParentNode(Node value)
Sets the parent node.
|
void |
setVisible(boolean value)
Sets to show the node
|
java.lang.String |
toString()
Gets the string reprensentation of this node.
|
getScene
findProperty, getName, getProperties, getProperty, removeProperty, removeProperty, setName, setProperty
public Node()
Node
class.public Node(java.lang.String name, Entity entity)
Node
class.name
- Name.entity
- Default entity.public Node(java.lang.String name)
Node
class.name
- Name.public AssetInfo getAssetInfo()
public void setAssetInfo(AssetInfo value)
value
- New valuepublic boolean getVisible()
public void setVisible(boolean value)
value
- New valuepublic java.util.List<Node> getChildNodes()
public Node createChildNode()
public Node createChildNode(java.lang.String nodeName)
nodeName
- The new child node's namepublic Node createChildNode(Entity entity)
entity
- Default entity attached to the nodepublic Node createChildNode(java.lang.String nodeName, Entity entity)
nodeName
- The new child node's nameentity
- Default entity attached to the nodepublic Node createChildNode(java.lang.String nodeName, Entity entity, Material material)
nodeName
- The new child node's nameentity
- Default entity attached to the nodematerial
- The material attached to the nodepublic Entity getEntity()
public void setEntity(Entity value)
value
- New valuepublic boolean getExcluded()
public void setExcluded(boolean value)
value
- New valuepublic java.util.List<Entity> getEntities()
public java.util.List<CustomObject> getMetaDatas()
public java.util.List<Material> getMaterials()
public Material getMaterial()
public void setMaterial(Material value)
value
- New valuepublic Node getParentNode()
public void setParentNode(Node value)
value
- New valuepublic Transform getTransform()
public Matrix4 evaluateGlobalTransform(boolean withGeometricTransform)
withGeometricTransform
- Whether the geometric transform is needed.public GlobalTransform getGlobalTransform()
public Node getChild(int index)
index
- Index.public Node getChild(java.lang.String nodeName)
nodeName
- The child name to find.public boolean accept(NodeVisitor visitor)
visitor
- Visitor callback to visit the nodepublic java.lang.String toString()
toString
in class java.lang.Object
public BoundingBox getBoundingBox()
public void addEntity(Entity entity)
entity
- The entity to be attached to the nodepublic void addChildNode(Node node)
node
- The child node to be attachedpublic java.lang.Object selectSingleObject(java.lang.String path) throws ParseException
path
- ParseException
- ParseException will be thrown if the path contains malformed query.public java.util.ArrayList<java.lang.Object> selectObjects(java.lang.String path) throws ParseException
path
- ParseException
- ParseException will be thrown if the path contains malformed query.