Animating Geometric Algorithms Over the Web - CiteSeerX

1 downloads 0 Views 315KB Size Report
for algorithm animation over the World Wide Web with a client-server ... on the Internet, and allows users with limited comput- ing resources to access animations ...
Animating Geometric Algorithms Over the Web James E. Baker y

Isabel F. Cruz z

Abstract Extensive work has been done on the animation of geometric algorithms, as con rmed by the videos and demonstrations presented at the ACM Computational Geometry Symposium. Mocha is a new distributed model for algorithm animation over the World Wide Web with a client-server architecture that optimally partitions the software components of a typical algorithm animation system, and leverages the power of the Java language, an emerging standard for distributing interactive platform-independent applications across the Web.

Algorithm Animation on the Internet Following the event-driven approach advocated by Brown and the conceptual framework pioneered by Stasko we view algorithm animation as an event driven system of communicating processes: the algorithm augmented with annotations of interesting events, called algorithm operations, and the animation component that provides the multimedia visualization of the the algorithm operations. We further subdivide the animation component into the GUI, which handles the interaction with the user, and the animator, which maps algorithm operations and user requests into dynamic multimedia scenes. The X Window system provides a basic clientserver mechanism for algorithm animation over the Internet, which we shall call X model. Namely, an animation program running on a remote machine can interact with the X server on the local user's machine by opening there a window, sending graphic output and receiving the user's keyboard and mouse actions. While this mechanism is simple to implement, there are signi cant security problems associated with remote X sessions, and the communication load placed on the Internet is

 Research supported in part by the National Science Foundation under grant CCR{9423847, by the U.S. Army Research Oce under grants DAAH04{93{0134 and DAAH04{96{1{0013, and by the N.A.T.O.-C.N.R. Advanced Fellowships Programme. y Department of Computer Science, Brown University, 115 Waterman Street, Providence, RI 02912{1910, USA.

fjib,gl,[email protected]

z Department of Electrical Engineering and Computer Science Tufts University, 161 College Avenue, Medford, MA 02155, USA.

[email protected]

Giuseppe Liotta y

Roberto Tamassia y

quite high. The arrival of the HotJava browser and of the Java language opens the possibility of embedding interactive applications in HTML documents, which are executed on the user machine after their code has been transferred. This a very attractive possibility provided that the user machine is powerful enough to run a sophisticated animation algorithm and that the provider of the animation does not mind sharing the code with the rest of the world. To overcome the problems inherent in the X and the Java model, we have proposed a new model, called Mocha, for algorithm animation over the World Wide Web [1]. Mocha is a distributed model with a clientserver architecture that optimally partitions the software components of a typical algorithm animation system, and leverages the power of the Java language. In the Mocha model, only the interface code is exported to the user machine, while the algorithm is executed on a server that runs on the provider's machine. See Figure 1. Mocha provides high levels of security, protects the algorithm code, places a light communication load on the Internet, and allows users with limited computing resources to access animations of computationally expensive algorithms. The user interface combines fast responsiveness and user friendliness with the powerful authoring capabilities of hypertext narratives. We employ multithreading in the implementation of the GUI and animator to provide more responsive feedback to the user. Also, we use an object-oriented container/component software architecture that guarantees expandability. Finally, we have mediators that isolate the commonality between the interaction of the clients and servers and provide a high degree of interoperability.

Animating Geometric Algorithms with Mocha

We have implemented a prototype of an animation system for geometric algorithms based on the Mocha model that can be accessed by any user with a WWW browser supporting Java (currently Netscape 2.0 and HotJava) at URL http://www.cs.brown.edu/people/jib/ Mocha.html. From the user's viewpoint, interacting with GS is as simple as Web sur ng. Namely, the user interacts with a hypertextual interface written in HTML, which is transferred over the Web to the user's machine to-

GUI CODE

ANIMATION

LIBRARY

CODE WWW BROWSER

LIBRARY

USER 1

MM CODE LIBRARY

mm commands / events

GUI code / mm doc.

GUI algorithm input / control mm commands / events animation code / mm doc / algorithm operations

MM DOCS / CODE SERVER

ANIMATOR

ANNOTATED ALGORITHMS LIBRARY algorithm input / control

ALGORITHM SERVER

INTERNET

GUI code / mm doc. / animation code

WWW BROWSER

algorithm operations

USER N

mm commands / events

GUI code / mm doc.

GUI algorithm input / control

ANNOTATED

mm commands / events

ALGORITHMS

animation code / mm doc / algorithm operations

LIBRARY

ANIMATOR algorithm input / control

ALGORITHM SERVER algorithm operations

http / Animation Protocol

ALGORITHM EXECUTION

sockets

GUI ALGORITHM ANIMATION

TCP/IP

Figure 1: Algorithm animation in the Mocha model. gether with the GUI and the Animator code from the Multimedia Documents/Code Server. The hypertextual interface is structured in various sections, each provided with \interactive gures". We provide two examples of such interactive gures. Suppose the user wants to animate the Delaunay triangulation algorithm (see Fig. 2(a)). The user simply places the sites (with simple click/drag/drop mouse actions) on the canvas of the interactive gures. The GUI sends to the algorithm server messages about changes of the input, such as addition, deletion, or translation of sites. The algorithms server updates the Delaunay triangulation and sends to the animator the corresponding events. The animator then updates the multimedia scenes associated with the visualization of the new Delaunay triangulation. In the proximity graph animation (see Fig. 2(b)), an advanced interaction technique allows the user to de ne the value of the parameter , which de nes the -skeleton of a set of points, by sliding a cursor along a logarithmic-scale ruler. Certain values of , which are of special interest in the theory of proximity graphs, are explicitly highlighted below the ruler and cause the cursor to \snap" when dragged near them.

References

[1] J. E. Baker, I. F. Cruz, G. Liotta, and R. Tamassia. A new model for algorithm animation over the WWW. ACM Computing Surveys, 27(4):568{572, 1995.

(a)

(b) Figure 2: (a) Delaunay triangulation animation. (b) Proximity graph animation.