[xgap] 2.2 What you can do with XGAP

[Up] [Previous] [Next] [Index]

# 2.2 What you can do with XGAP

XGAP graphic sheets work graphic object oriented. This means that the basic graphic objects are not pixels but lines, rectangles, circles and so on. Although technically everything on the screen consists of pixels XGAP remembers the structure of your graphics via higher objects. This has advantages as well as disadvantages. Do not expect to be able to place pixel images into your XGAP graphic sheets. That is as of now not possible with XGAP and probably will never be, because it is not the idea of the design.

What you can do is create, move around and change lines, circles, text and so forth in graphic sheets. Your programs can communicate with the user via graphical user interfaces like mouse, menus, dialogs, and so on.

It is very easy to link this graphical environment with your programs in the mathematical environment of GAP. So you can very quickly implement visualizations of the mathematical objects you study. The user can select objects, choose functions from menus and ask for more information with a few mouse clicks.

A good example for this approach is the implementation of the interactive Todd-Coxeter-Algorithm to compute coset tables in finitely presented groups. It uses the graphical features of XGAP to give the user quick and easy access to the algorithm by a few mouse clicks. This program was written by Ludger Hippe in Aachen using XGAP3 and is currently ported to XGAP4 and extended by Volkmar Felsch.

Another nice little example is in the `examples` subdirectory in the XGAP distribution. It was written by Thomas Breuer (Aachen) to demonstrate the features of XGAP. The user gets a small window with a puzzle and can solve it using the mouse. You can test this example by starting XGAP and `Read`ing the file `pkg/xgap/examples/puzzle.g`. You can do this by using

    gap> ReadPkg("xgap","examples/puzzle.g");
    gap> p := Puzzle(4,4);

You do not have to invent the wheel many times. For certain mathematical concepts like graphs, posets or lattices XGAP provides implementations which can be adapted to your special situation. You can use those parts of the code you like and substitute the other parts to adapt the behaviour of the user interface to your wishes.

[Up] [Previous] [Next] [Index]