4D Graphics
Volume Number: 7
Issue Number: 2
Column Tag: Database Corner
Related Info: Quickdraw
4th Dimension Graphics
By Haven C. Sweet, Orlando, FL
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
Graphics Output in Fourth Dimension.
Haven Sweet is a Professor of Biology at the University of Central Florida. He
has been interested in using the Macintosh for a variety of educational purposes, and
has tried to incorporate the computer into an academic laboratory setting. He has
developed several classroom exercises using 4th Dimension.
Introduction
Although Fourth Dimension (4D) is not a programming language, I prefer to use
it for most of my projects since it vastly simplifies programming and managing
complex data. However, I recently discovered a very unfortunate limitation of Fourth
Dimension; it is unable to draw on the screen using tool box calls.
The Problem
After creating a large data base of organisms with 4D, I added calculations for a
cluster analysis to elucidate their possible relationships. When I wanted to present the
final results in a dendrogram (Figure 1), I discovered there was no simple mechanism
for drawing on the screen or printing text at variable locations.
Figure 1. A sample clustering output, showing the similarity of four different records
in the data base. The figure was drawn on an output layout which only contained the
buttons.
I would have to write the entire graphics routine in Pascal, compile it as an
external procedure, and create external areas within my program. Not being proficient
with MPW, I was hesitant to attempt writing anything which would require debugging
by switching from MPW to Ext. Mover to 4D to MPW etc. Hoping version 2 would
provide direct toolbox routines such as MoveTo(xStart,yStart), LineTo(xEnd,yEnd) and