# Scripting API for Rooted Tree Backend

## Rooted Tree Data Structure

The data structure properties dialog allows access to configure settings specific to the Graph backend. There, by checking the Show all pointers property, all pointers between the tree nodes are shown. If unchecked, multiple pointers between same nodes are collapsed to one.

## The Rooted Tree Structure

Given a data structure object of type "Rooted Tree", the following properties can be read or written:

        ShowAllPointers     // set to true if show all edges, set to false if multiple edges shall be compressed

Given a data structure object of type "Rooted Tree", you can call the following member functions:

        node add_data(string name);         // add a node to tree with given name
        void set_root_node(node root);      // set root as root node of the tree
        node root_node();                   // return root node of the tree

## Rooted Tree Nodes

Given a node object of type "Rooted Tree", the following properties can be read or written:

        int numberOfChilds                  // set the number of (allowed) children for this node
        node left_child                     // read only: node that is the left child
        node right_child                    // read only: node that is the right child
        node node_parent                    // read only: node that is the parent

Given a node object of type "Rooted Tree", you can call the following member functions:

        node add_left_child(node child);    // add left child
        node add_right_child(node child);   // add right child
        node add_child(node child, int i);  // add a child as the i-th child of the node
        node add_node_parent(node child);   // add parent (only successful if no parent set, yet)
        node left_child();                  // return right child
        node right_child();                 // return left child
        node child_at(int i);               // return the i-th child of the node
        node node_parent();                 // return the node's parent

## Rooted Tree Edges

Given edges of a data structure of type "Rooted Tree", only the properties of the base data structure are available.