com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Node



  • public class Node
    extends A3DObject
    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.
    • Constructor Detail

      • Node

        public Node()
        Initializes a new instance of the Node class.
      • Node

        public Node(String name,
                    Entity entity)
        Initializes a new instance of the Node class.
        Parameters:
        name - Name.
        entity - Default entity.
      • Node

        public Node(String name)
        Initializes a new instance of the Node class.
        Parameters:
        name - Name.
    • Method Detail

      • getAssetInfo

        public AssetInfo getAssetInfo()
        Per-node asset info
      • setAssetInfo

        public void setAssetInfo(AssetInfo value)
        Per-node asset info
        Parameters:
        value - New value
      • getVisible

        public boolean getVisible()
        Gets to show the node
      • setVisible

        public void setVisible(boolean value)
        Sets to show the node
        Parameters:
        value - New value
      • getChildNodes

        public List<Node> getChildNodes()
        Gets the children nodes.
      • createChildNode

        public Node createChildNode()
        Creates a child node
        Returns:
        The new child node.
      • createChildNode

        public Node createChildNode(String nodeName)
        Create a new child node with given node name
        Parameters:
        nodeName - The new child node's name
        Returns:
        The new child node.
      • createChildNode

        public Node createChildNode(Entity entity)
        Create a new child node with given entity attached
        Parameters:
        entity - Default entity attached to the node
        Returns:
        The new child node.
      • createChildNode

        public Node createChildNode(String nodeName,
                                    Entity entity)
        Create a new child node with given node name
        Parameters:
        nodeName - The new child node's name
        entity - Default entity attached to the node
        Returns:
        The new child node.
      • getEntity

        public Entity getEntity()
        Gets the first entity attached to this node, if sets, will clear other entities.
      • setEntity

        public void setEntity(Entity value)
        Sets the first entity attached to this node, if sets, will clear other entities.
        Parameters:
        value - New value
      • getExcluded

        public boolean getExcluded()
        Gets wheather to exclude this node and all child nodes/entities during exporting.
      • setExcluded

        public void setExcluded(boolean value)
        Sets wheather to exclude this node and all child nodes/entities during exporting.
        Parameters:
        value - New value
      • getEntities

        public List<Entity> getEntities()
        Gets all node entities.
      • getMetaDatas

        public List<CustomObject> getMetaDatas()
        Gets the meta data defined in this node.
      • getMaterials

        public List<Material> getMaterials()
        Gets the materials associated with this node.
      • getMaterial

        public Material getMaterial()
        Gets the first material associated with this node, if sets, will clear other materials
      • setMaterial

        public void setMaterial(Material value)
        Sets the first material associated with this node, if sets, will clear other materials
        Parameters:
        value - New value
      • getParentNode

        public Node getParentNode()
        Gets the parent node.
      • setParentNode

        public void setParentNode(Node value)
        Sets the parent node.
        Parameters:
        value - New value
      • getTransform

        public Transform getTransform()
        Gets the local transform.
      • getGlobalTransform

        public GlobalTransform getGlobalTransform()
        Gets the global transform.
      • getChild

        public Node getChild(int index)
        Gets the child node at specified index.
        Parameters:
        index - Index.
        Returns:
        The child.
      • getChild

        public Node getChild(String nodeName)
        Gets the child node with the specified name
        Parameters:
        nodeName - The child name to find.
        Returns:
        The child.
      • accept

        public boolean accept(NodeVisitor visitor)
        Walks through all descendant nodes(including the current node) and call the visitor with the node. Visitor can break the walkthrough by returning false
        Parameters:
        visitor - Visitor callback to visit the node
        Returns:
        true means visitor has broke the walk through.
      • toString

        public String toString()
        Gets the string reprensentation of this node.
        Overrides:
        toString in class Object
        Returns:
        The string representation of this node for debugging.
      • getBoundingBox

        public BoundingBox getBoundingBox()
        Calculate the bounding box of the node
      • addEntity

        public void addEntity(Entity entity)
        Add an entity to the node.
        Parameters:
        entity - The entity to be attached to the node
      • addChildNode

        public void addChildNode(Node node)
        Add a child node to this node
        Parameters:
        node - The child node to be attached
      • findNode

        public Node findNode(String name)
        Find child node by its name or return null if no matched node found
        Parameters:
        name -