LEDA, a Platform for Combinatorial and Geometric Computing:Visualization

Visualization

Visualization and animation of programs is very important for the understanding, presentation, and debugging of algorithms (see Chapter 44).

Leda provides two powerful tools

for interactive visualization and animation of data structures and algorithms:

Graph Win

The Graph Win data type (see [27], chapter 12) combines the graph and the window data type. An object of type Graph Win (short: a Graph Win) is a window, a graph, and a drawing of the graph, all at once. The graph and its drawing can be modified either by mouse operations or by running a graph algorithm on the graph. The Graph Win data type can be used to:

• construct and display graphs,

• visualize graphs and the results of graph algorithms,

• write interactive demos for graph algorithms,

image

FIGURE 41.1: A Graph Win. The display part of the window shows a graph G and the panel part of the window features the default menu of a Graph Win. G can be edited interactively, e.g., nodes and edges can be added, deleted, and moved around. It is also possible to run graph algorithms on G and to display their result or to animate their execution.

• animate graph algorithms.

All demos and animations of graph algorithms in Leda are based on Graph Win, many of the drawings in the Leda book ([27]) have been made with Graph Win, and many of the geometry demos in Leda have a Graph Win button that allows us to view the graph structure underlying a geometric object.

Graph Win can easily be used in programs for constructing, displaying and manipulating graphs and for animating and debugging graph algorithms. It offers both a programming and an interactive interface, most applications use both of them.

Geo Win

Geo Win ([23]) is a generic tool for the interactive visualization of geometric algorithms. Geo Win is implemented as a C++data type. It provides support for a number of programming techniques which have shown to be very useful for the visualization and animation of algorithms. The animations use smooth transitions to show the result of geometric algorithms on dynamic user-manipulated input objects, e.g., the Voronoi diagram of a set of moving points or the result of a sweep algorithm that is controlled by dragging the sweep line with the mouse (see Figure 41.2).

clip_image004

FIGURE 41.2: GeoWin animating Fortune’s Sweep Algorithm.

A Geo Win maintains one or more geometric scenes. A geometric scene is a collection of geometric objects of the same type. A collection is simply either a standard C++-list (STL-list) or a Leda-list of objects. Geo Win requires that the objects provide a certain functionality, such as stream input and output, basic geometric transformations, drawing and input in a Leda window. A precise definition of the required operations can be found in the manual pages [11]. Geo Win can be used for any collection of basic geometric objects (geometry kernel) fulfilling these requirements.

The visualization of a scene is controlled by a number of attributes, such as color, line width, line style, etc. A scene can be subject to user interaction and it may be defined from other scenes by means of an algorithm (a C++ function). In the latter case the scene (also called result scene) may be recomputed whenever one of the scenes on which it depends is modified. There are three main modes for re-computation: user-driven, continuous, and event-driven.

Geo Win has both an interactive and a programming interface. The interactive interface supports the interactive manipulation of input scenes, the change of geometric attributes, and the selection of scenes for visualization.

Comments

Popular posts from this blog

Data Structure Visualization:Introduction and Value of Data Structure Rendering

Collision Detection:Penetration Depth Computation

Concurrent Data Structures:Linked Lists