Node
Overview
Node is a class in Aspose.3D FOSS for .NET.
Inherits from: SceneObject.
Represents an element in the scene graph. A scene graph is a tree of Node objects. The tree management services are self contained in this class. Note the Aspose.3D SDK does not test the validity of the constructed scene graph. It is the responsibility of the caller to make sure that it does not generate cyclic graphs in a node hierarchy. Besides the tree management, this class defines all the properties required to describe the position of the object in the scene. This information include the basic Translation, Rotation and Scaling properties and the more advanced options for pivots, limits, and IK joints attributes such the stiffness and dampening. When it is first created, the Node object is “empty” (i.e: it is an object without any graphical representation that only contains the position information). In this state, it can be used to represent parents in the node tree structure but not much more. The normal use of this type of objects is to add them an entity that will specialize the node (see the “Entity”). The entity is an object in itself and is connected to the the Node. This also means that the same entity can be shared among multiple nodes. Camera, Light, Mesh, etc… are all entities and they all derived from the base class Entity.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
AssetInfo | AssetInfo? | Read/Write | Gets or sets optional asset metadata associated with the node |
Visible | bool | Read/Write | Indicates whether the node is visible in the scene |
ChildNodes | IList<Node> | Read | Provides a list of this node’s direct child nodes |
Entity | Entity? | Read/Write | Gets or sets the primary entity attached to the node |
Excluded | bool | Read/Write | Indicates whether the node is excluded from processing or export |
Entities | IList<Entity> | Read | Provides a collection of all entities attached to the node |
MetaDatas | IList<CustomObject> | Read | Provides a list of custom metadata objects associated with the node |
Materials | IList<Shading.Material> | Read | Provides a list of materials applied to the node |
Material | Shading.Material? | Read/Write | Gets or sets the primary material of the node |
ParentNode | Node? | Read/Write | Gets the parent node of this node, or null if it is the root |
Transform | Transform | Read | Gets the local transform applied to the node |
GlobalTransform | GlobalTransform | Read | Gets the computed global transform of the node |
Methods
| Signature | Description |
|---|---|
Node() | Creates a node with name and attached entity |
Node(name: string) | |
Node(name: string, entity: Entity) | |
CreateChildNode() | Creates a child node |
CreateChildNode(nodeName: string) | Creates a child node |
CreateChildNode(entity: Entity) | Creates a child node |
CreateChildNode(nodeName: string, entity: Entity) | Creates a child node |
CreateChildNode(nodeName: string, entity: Entity, material: Shading.Material) | Creates a child node |
AddChildNode(node: Node) | Add a child node to this node |
AddEntity(entity: Entity) | Add an entity to the node. |
Merge(node: Node) | Detach everything under the node and attach them to current node. |
EvaluateGlobalTransform(withGeometricTransform: bool) | Evaluate the global transform, include the geometric transform or not. |
GetChild(index: int) | Gets the child node at specified index. |
GetChild(nodeName: string) | Gets the child node at specified index. |
Accept(visitor: NodeVisitor) | Walks through all descendant nodes(including the current node) and call the visitor with the node. Visitor can break the walk-through by returning false |
GetBoundingBox() | Calculate the bounding box of the node |
SelectSingleObject(path: string) | Select single object under current node using XPath-like query syntax. |
SelectObjects(path: string) | Select multiple objects under current node using XPath-like query syntax. |
ToString() | Gets the string representation of this node. |