The Basic Concept of Mapping - How to make a valid mapping?
The Basic of Mappings - How to contruct a valid mapping
Although mapping editing is simply drag and drop the links between mapping nodes. There are some basic rules you should know. In this page, we describe the basic concepts of mapping node and the concept of Mapping Tree
Basics of Mapping Nodes
A mapping node has IN ports and OUT ports. An IN port can accept a single link from another source which can be a variable in the middle sub-window or a mapping node. An OUT port, on the other hand, can be linked to many other destinations. A mapping tree is evaluated to create its visualization from the bottom (i.e. the variables in the middle sub-window) of the tree to the root, where the links are used to pass objects between mapping nodes. For example, a mapping node that employs a sphere can be added to the editing area. It is well-known that the size of a sphere can be determined by its radius. So, this mapping node has an IN port named _vm_radius. If a variable which appears in the middle subwindow is linked to this port, the variable controls the size of the sphere every time the mapping tree is evaluated. This mapping node also has several OUT ports. These OUT ports contain the results of an evaluation. These results include a reference to this sphere and its 3D properties.
Why a mapping need to form a tree?
A tree has a root; that is, the links of mapping nodes must finally converge to a single mapping node and this mapping node should carry a VM.
Why is that? Take a class of binary tree node for example.
class btnode { boolean value ; btnode left; btnode right; };
When an object Q of class btnode is visualized, the following mapping is valid because it is a tree with a root node which carries a VM. The reason is that xDIVA need to know which VM will represent the object Q. If there are more than one VM or no VM to represent object Q, xDIVA will complain.
Besides the root VM is used to represent object Q. In this mapping, xDIVA will try to find the VM to represent each variable in object Q. For example, in the above mapping, xDIVA can start from variable travel. When first VM is encountered, this VM will be used to represent the variable travel. This simple rule may fail. In the future, users should be able to override the rule and make the pairs by their own will.
No Cyclic links are allowed
This rule in mapping editing is true for any cases. However, current xDIVA does not validate this issue for you. You should be aware of that any cyclic linking may crash the xDIVA.