TSIPP Workbench - Working Widgets
Without
Code
Introduction
TSIPP is a 3-D image
specification and rendering toolkit for use with Tcl and Tk,
and
the TSIPP Workbench is an interactive tool for creating visual scenes in
3-D using TSIPP. The main goal of TSIPP is visualization; the understanding
of data in science or engineering (see ref. [2] p. 9). Towards this objective,
the TSIPP Workbench can be used to create a class of megawidgets which:
-
have the appearance of visual scenes with photographic realism;
-
can vary with time (animation) or other control stimulus;
-
are interactive in that they may solicit input.
An example of this would be to create a "hydraulic widget" that indicates
the water level in a reservoir. During an interactive session the image
of the widget is defined, as well as the methods to be supported and their
effect on the image. The result is a regular Tk widget that can be immediately
used with minimal code (this file can be found in the "examples" directory,
named "hydraulic_animate"):
#!/bin/sh
# standard executable Tcl file ...
\
exec tksipp "$0" "$@"
set env(TSIPPwb) [file dir [info script]]/..
lappend auto_path $env(TSIPPwb)/tcl
package require RLE_animate
class hydraulic {
inherit RLE_animate
}
pack [hydraulic .r]
-side left
pack [scale .s
\
-to
1
\
-from
[.r cget -n_frame] \
-command {.r show}
\
-label "Water
Level"] -side right
...
which changes to ...
as
the slider is moved.
The animation of the image encompasses more than just movements of the
objects in the scene. Camera positions, positions of light sources, and
the intensity and characteristics of the image can all be controlled by
methods of the widget. In the following example, a representation of activity
in a nuclear reactor is related to control rod position:
raise
the control rods, and see that core cook! ...
Subsystem Interfaces
The TSIPP Workbench comprises an incr-Tcl program which interfaces to TSIPP,
which at present is statically linked to the wish executable. This in turn
provides a Tcl command interface to SIPP, the
SImple Polygon
Processor
library. The state of the TSIPP Workbench can be saved as a plain-text
incr-Tcl source file, which may be reloaded to restore the state of the
tool. This Tcl source file can be thought of as the "source" for the image.
As a human readable incr-Tcl program it provides the potential for interfacing
to other image processing systems, or of implementing recovery from tool
problems which make the file unreadable, which would be significantly more
difficult if the image source was in binary format.
Still images may be written to a PPM format file, as defined
by the PBMPlus toolkit, while animated images are written out as
an RLE file, as defined by the Utah Raster Toolkit.
To fulfill its role as a widget creator, it is intended that the tool
will generate incr-Tcl class definitions for a widget that has the appearance
of the image as drawn, complete with methods which vary the appearance
as defined using the tool. This has not yet been implemented, and as can
be seen in the example code for the desk widget above, a standard widget
is used through inheritance. The widget loads an RLE file with a name which
by default is derived from the name of the widget, but may be specified
explicitly as a parameter to the constructor.
Using the TSIPP Workbench
While 3-D drawing on a computer may appear difficult, 2-D drawing is familiar
to users of word processors. The GUI of the TSIPP Workbench presents three
orthogonal 2-D views of the scene, together with additional views for defining
colors, textures, motion and overall control. Refer to the links for each
of these as follows:
-
on the left hand side of the GUI there are four panels controlling different
aspects of the image, ordered top-to-bottom as follows:
-
the File Control panel controls the
loading and saving of source for the image, and the pbm files for rendered
images.
-
the Mode Select panel determines what type
of operation will be performed by mouse actions in the orthogonal views.
-
the Rendering Control panel controls
how the final image will be generated.
-
the Operations on Selected Items panel
allows operations to be performed on all items selected in the orthogonal
views.
-
the Front, Plan and Side views show the image
as if projected onto three orthogonal screens. Editing of the image can
be carried out in whichever view is easiest.
-
the Shader/Light view focuses on the components
of the scene such as the shaders used to give solid objects color and texture
and to control the intensity and other characteristics of the lights used
to illuminate them.
-
the Motion view allows the image to be defined
differently for different frames, and controls the interpolation process.
-
the perspective view shows the final result of the image definition.
Installation
The TSIPPwb program is distributed with all binaries and may be executed
after "unzipping" and "un-tarring" the release package. Suppose that it
has been located at /home/abc/TSIPPwb1.0, then execute /home/abc/TSIPPwb1.0/tcl/TSIPPwb.
You may wish to hit "Load" and select one of the examples in the examples
directory; for example /home/abc/TSIPPwb1.0/examples/workbench.tcl, which
is the source file for the program icon.
To install the program, run the utility "INSTALL". This allows you to
install either the TSIPPwb program and/or the binaries it requires, and
to make the TSIPPwb program refer to those installed binaries, or any other
binaries of your choice. Note that if binaries (or libraries) with the
same names can be found in /usr/local these will be used in preference
to any specified binaries.
For more details, please refer to the README file.
Execution
Ideally, the "bin" directory containing the executable should be in your
environment variable PATH. Then execute the following command. The TSIPPwb
executable takes one optional parameter which is the name of an existing
source file to load on startup, which must have extension ".tcl":
TSIPPwb [<filename>.tcl]
Note that as is traditional, the INSTALL script created a softlink without
the version pointing to the installed version; i.e., TSIPPwb -> TSIPPwb1.0.
See the README file for more details.
Configuration and Customization
See Configuration
Known Problems
This version of the TSIPPwb must be considered an alpha release, and several
problems are known.
Acknowledgments
Author of the Tcl Interface - TSIPP
Mark Diekhans <markd@Kermodei.com>
Authors of SIPP
The SIPP 3D rendering package was developed by Jonas Yngvesson <jonas-y@isy.liu.se>
and Inge Wallin <ingwa@isy.liu.se> of the Linkoping
Institute of Technology, Sweden.
Authors of URT
The Utah Raster Toolkit RLE library developed by Spencer W. Thomas and
others.
References
[1] TSIPP - 3D Graphics Toolkit for Tcl/Tk, Mark Diekhans. See the
README file for details of downloading. The latest version available is
tsipp3.3b2, but the distribution of TSIPPwb contains patches to this.
[2] "TCL/TK Tools", Mark Harrison, O'Reilly, 1997, ISBN 1-56592-218-2.
[2] "Tcl Style Guide", Ray Johnson, Sun Microsystems, Inc., August
22nd, 1997.
[3] "Namespaces and Packages", William H Duquette, 2000.
[4] "Effective Tcl/Tk Programming", Harrison
and McLennan, 1998, Addison-Wesley, ISBN 0-201-63474-0.
Send all questions, comments and bug reports to Paul Welton <paul.welton@sympatico.ca>.