DataPool

DataPool is a mechanism for managing data in Viz. The mechanism is implemented through a group of container function plugins and a group of scene plugins added to the Viz installation.

DataPool implementation allows Viz to keep information in named cells called DataFields. The data is managed at a separated, virtual, work space, linked to the graphics thru a set of plugins that make the connection between the DataFields and the graphic objects.

graphics/introduction_viz-diagram.png

Some of the DataPool plugins have no effect over the graphics and are used only for managing and manipulating data. Some DataPool plugins are used for assigning data to DataFields and some plugins control Viz behavior upon changes in DataField values, affecting the graphic objects.

The native communication protocol to Viz is command oriented. Any change of the graphic objects, requires a separate command that is sent to the renderer. Each command includes the path to the container and the operation performed on the container.

Example

In a scene with a cube object, the cube can be scaled, moved, its bevel parameter changed, etc.

This is done by sending a command to Viz that specifies the name of the cube, its location in the Viz scene tree, the parameter to be changed and the new value for the parameter. If we add a font object to the same scene, we would be able to modify different parameters of the object, like setting its font, contents, kerning and so on.

If we want to implement a histogram of one single bar formed by the cube and the text object, setting the bar to the value "10", we will need to send Viz the following commands:

  • Set the font object to display the string "10" (maybe add a suffix or prefix like a dollar sign: $10).

  • Calculate the size of the cube and send the correct scaling value command Viz.

To change the value of the bar, two commands were sent, containing a different format for displaying the same graphic information: setting the bar to the value 10.

Another issue is that each external command sent to Viz contains the address of the container to which it is addressed. If a software program needs to send the two commands to Viz, it has to know the names of the containers and their location in the scene hierarchy. If an external application is written controlling a scene, the scene hierarchy and container names cannot be changed in the scene.

All these issues mentioned previously create difficult maintenance problems. DataPool is designed to solve these problems. It extends the external command mechanism of Viz, allowing the user, or the controlling software, to send data rather than container specific operations. The data is addressed to named fields (DataFields). The scene designer uses special purpose plugins, used for processing and handling the incoming data.

If we modify the previous example to use the DataPool mechanism, a DataText plugin is added to the text object and a DataScale plugin is added to the cube object. Both plugins are registered to receive data from the same DataField named "Bar Value". As soon as "Bar Value" changes both plugins will react, the first changing the string of the text object and the second scaling the cube. The data is sent to the scene through a scene plugin called DataPool. This plugin is just an interface to enter the data. Once this plugin is defined in the scene, any external software can address it without the need of knowing the scene hierarchy or the container names.