vispy.scene.node.
Node
Bases: object
object
Base class representing an object in a scene.
A group of nodes connected through parent-child relationships define a scenegraph. Nodes may have any number of children.
Each Node defines a transform property, which describes the position, orientation, scale, etc. of the Node relative to its parent. The Node’s children inherit this property, and then further apply their own transformations on top of that.
transform
With the transform property, each Node implicitly defines a “local” coordinate system, and the Nodes and edges in the scenegraph can be thought of as coordinate systems connected by transformation functions.
The parent of the Node.
The name used to identify the node.
The associated transforms.
canvas
The canvas in which this node’s scenegraph is being drawn.
children
A copy of the list of children of this node. Do not add items to this list, but use x.parent = y instead.
x.parent = y
clip_children
Boolean indicating whether children of this node will inherit its clipper.
clipper
A visual filter that can be used to clip visuals to the boundaries of this node.
common_parent
Return the common parent of two entities
If the entities have no common parent, return None.
The other node.
The parent.
describe_tree
Create tree diagram of children
If true, add information about node transform types.
The tree diagram.
document
The document is an optional property that is an node representing the coordinate system from which this node should make physical measurements such as px, mm, pt, in, etc. This coordinate system should be used when determining line widths, font sizes, and any other lengths specified in physical units.
The default is None; in this case, a default document is used during drawing (usually this is supplied by the SceneCanvas).
document_node
The node to be used as the document coordinate system.
By default, the document node is self.root_node.
is_child
Check if a node is a child of the current node
The potential child.
Whether or not the node is a child.
name
node_path
Return two lists describing the path from this node to another
First path (see below).
Second path (see below).
Notes
The first list starts with this node and ends with the common parent between the endpoint nodes. The second list contains the remainder of the path from the common parent to the specified ending node.
For example, consider the following scenegraph:
A --- B --- C --- D --- E --- F
Calling D.node_path(F) will return:
([D, C, B], [E, F])
node_path_to_child
Return a list describing the path from this node to a child node
If node is not a (grand)child of this node, then raise RuntimeError.
The child node.
The path.
node_path_transforms
Return the list of transforms along the path to another node.
The transforms are listed in reverse order, such that the last transform should be applied first when mapping from this node to the other.
A list of Transform instances.
node_transform
Return the transform that maps from the coordinate system of self to the local coordinate system of node.
Note that there must be a _single_ path in the scenegraph that connects the two entities; otherwise an exception will be raised.
The transform.
on_parent_change
Parent change event handler
The event.
opacity
order
A value used to determine the order in which nodes are drawn.
Greater values are drawn later. Children are always drawn after their parent.
parent
The parent of this node in the scenegraph.
Nodes inherit coordinate transformations and some filters (opacity and clipping by default) from their parents. Setting this property assigns a new parent, changing the topology of the scenegraph.
May be set to None to remove this node (and its children) from a scenegraph.
parent_chain
Return the list of parents starting from this node. The chain ends at the first node with no parents.
picking
Boolean that determines whether this node (and its children) are drawn in picking mode.
root_node
scene_node
The first ancestor of this node that is a SubScene instance, or self if no such node exists.
set_transform
Create a new transform of type and assign it to this node.
All extra arguments are used in the construction of the transform.
The transform type.
Arguments.
Keywoard arguments.
The transform that maps the local coordinate frame to the coordinate frame of the parent.
update
Emit an event to inform listeners that properties of this Node have changed. Also request a canvas update.
visible
Whether this node should be drawn or not. Only applicable to nodes that can be drawn.