Last updated

Node

# Introduction

Node is the base class for all shapes and groups of shapes in scene graph.

# API

The picture below shows its schematic class diagram for node Node.

  • The checkCollision() method tests if the node is in the specified area. If a parent does not pass the test then the system does not do any further testing or processing of child nodes
  • The getParent() method returns the parent node. A node can only have one parent.
  • The getRoot() method returns the root node in the hierarchy.
  • The render method renders the node into the RenderingContext.
  • The invalidate() method notifies the parent that the current node should be rendered.
  • The getWorldTransform() method returns an affine transformation of the contents to the parent. This transformation specifies how a point in inner model coordinates is transformed to a point in parent coordinates. This transformation is optional and identity by default.
  • The getSceneTransform() method returns a concatenation of all local parent transformations from a given node to the scene that contains a root node. This transformation specifies how a point in the inner model coordinates will be transformed to a scene point (device point).

# Important

Important information about nodes:

  • A node can be rendered locally or remotely, which depends on the implementation.
  • A node can be laid out in the parent node model coordinates. A toolkit can provide a set of the predefined layouts like box layout, grid layout or a node can be placed in the parent-relative coordinates.
  • A node can be shifted, scaled, or rotated in parent-coordinates.