Previous Next Table of Contents

6. Using the Shell Laboratory

The "Shell Laboratory" is a GUI for "libshelly". It is mainly a Tcl/Tk script and some C-code to interface to OpenGL (via Togl) and "libshelly".

The main goal of this GUI is to ease the process of parameterization through immediate display of the results.

6.1 Starting Up

The "Shell Laboratory" consists of Tcl/Tk-code and C-code. Therefore, after compiling the "Shell Laboratory" you have a Tcl-script "lab.tcl" and an executable "lab". To start the "Shell Laboratory" you might use the provided shell-script "slab".

>slab

This script needs a "sh" installed in "/bin". After installation of ShellyLib you have to edit the shell-script. The complete path to the file "lab.tcl" has to be added to the last line ("source "lab.tcl"") of the file "slab". Use of the tilde ("~") is allowed. If you didn't understand anything by now, read on.

You might also start the lab this way:

>lab lab.tcl

Note that "lab" has to be in the search path of your shell. And if "lab.tcl" is not in the current directory, you have to specify the full path to it. Let us assume you installed "lab" in a way that it is in your current search path. If you unpacked the ShellyLib distribution in your home directory and did not move the file "lab.tcl" you may start the "Shell Laboratory" now with:

>lab ~/ShellyLib-2.0/src/lab.tcl

Using an alias for this might be a good idea. The first thing you should do after startup is the tutorial, located in the "Help" menu.

6.2 The Main Window

Each parameter of the shell generator is represented as a line, containing

Since all those parameter-lines fit hardly on any screen, I put them into a scroll-able canvas. You might want to maximize the window size to your full screen height. You can cycle through the entries and sliders with <TAB> and <Shift+TAB>.

Each change of a sliders value results in the following internal actions. At first, a new shell is generated via "libshelly" in the mode selected in the "Shelly/Mode" sub menu. Then, the shell is displayed as wireframe or shaded polygonal model in the second window called "3D-View".

6.3 The Menu

6.4 The 3D-View

This window uses Togl to interface to OpenGL and draw the shell. The shell may be displayed as wireframe model or rendered using constant or smooth shading (Gourad-Shading). You may configure this with the "Mode" sub-menu in the "Rendering" menu.

You may rotate, zoom and move the shell (moving along z-axis only) with your mouse and keyboard.

A coordinate system is drawn to help you to navigate. It might be helpful to estimate the size of the object, as each axis is exactly 1 (whatever) long. It can be switched off with the "DrawCoordsys" check-button in the "Rendering" menu.

The view is updated every time you change the value of a parameter. You may change this behavior with the "AutoUpdate" check-button.

The projection mode is always perspective. If you get annoyed by the perspective distortions that may occur when viewing large objects, use the "Scale" parameter to shrink the shell.

If you are lost in space use <r> to reset to the default settings.

Please note, that no setting of the 3D-View has any influence on any 3D-objects written by the "Shell Laboratory".

Here are all the key and mouse bindings:

<Mouse-Button-1> (the left one) click and drag: rotate around x- and y-axis

<Cursor-Left>, <Cursor-Right>: rotate around z-axis

<Cursor-Up>, <Cursor-Down>: move along z-axis

<+>: zoom in

<->: zoom out

<r>: reset all transformations

Note that these key and mouse bindings are available in the 3D-View window only!

6.5 File Selection Boxes

Some menu-entries open one of these monsters. Seriously, when I switched from my beloved Amiga to a Linux-PC I felt lost after short time. I was used to standard "ASL" or "ReqTools" requesters, easy to use, functional and nice looking. On X11 everyone does his own thing, one worse than the other. So, I decided to reinvent the wheel too, and the result is a more or less Amiga-like file requester.

Directories are marked with a trailing slash ("/"). Right mouse-button is bound to "cd ..". Pressing <Return> in the list-box selects a file or changes the current directory. Double-click on a file selects this file, on directory changes to this directory.

Do I need to tell you more? Everything else should work as you expect.

Note: Due to a bug in Tk4.0, double-clicking on a file will pop up an error box. But the file you have selected will be loaded! It is just that little annoying box. Use the "Ok!" button (or keyboard). Otherwise you have to update your Tcl/Tk to get rid of it. Again, not my fault.

6.6 Slider Calibration

The initial configuration of the sliders has been choosen to protect you from potentially dangerous parameter values, that may crash the lab, and to ensure greatest possible freedom in setting any parameter.

From time to time it may be necessary to reconfigure a slider, so that other values than allowed by its initial configuration may be set. Each slider may be configured using the associated "Cal." button. This will open a modal dialog, where you can change minimum and maximum value and, important, the step-size or resolution of the slider. Note, that you cannot set any other value than x = min + (n * step-size), (x <= max) with the slider.

6.7 Notes about Entries

Normally, when you drag the slider the value of the entry is updated automatically. This could work vice versa but you would not be able to enter any other value than allowed by the configuration of the slider. You say you would not mind? Imagine the following: The entry shows a value of 200, slider configuration is 100, 360, 10. You want to change the value manually to 300. You would not be able to delete the leading 2 in the entry because the resulting value (0) does not fit into the slider! Editing would be a real nightmare.

My solution: The entry is temporarily disconnected from the slider when the entry gets the focus (either by mouse-click, or by <TAB> key). You may now edit the value freely. No update takes place, neither of the slider nor of the display. Then press <TAB> or select another entry with the mouse. The focus leaves the entry and the connection to the slider is established again. Slider and display are updated.


Previous Next Table of Contents