home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d574
/
chemesthetics.lha
/
Chemesthetics
/
Chemesthetics.doc
next >
Wrap
Text File
|
1991-12-22
|
40KB
|
951 lines
Chemesthetics V2.10
Manual
(C) 1990, 1991 by Joerg Fenin
Chemesthetics V2.10
----------------------------------------------------------------------
Table of contents
What is Chemesthetics . . . . . . . . . . . . . . . . . . . 3
Copyright, Distribution etc. . . . . . . . . . . . . . . . 3
Installation . . . . . . . . . . . . . . . . . . . . . . . 4
Files . . . . . . . . . . . . . . . . . . . . . . . . . 5
How to use Chemesthetics . . . . . . . . . . . . . . . . . 6
The entering of data . . . . . . . . . . . . . . . . . . 6
Display a molecule . . . . . . . . . . . . . . . . . . . 8
Save a molecule . . . . . . . . . . . . . . . . . . . . 8
Short menu overview . . . . . . . . . . . . . . . . . . . . 9
Copyright . . . . . . . . . . . . . . . . . . . . . . . 9
Credits . . . . . . . . . . . . . . . . . . . . . . 9
Project . . . . . . . . . . . . . . . . . . . . . . . . 9
Load Mol (Amiga-L) . . . . . . . . . . . . . . . . 9
Save Mol (Amiga-S) . . . . . . . . . . . . . . . . 9
new Mol (Amiga-N) . . . . . . . . . . . . . . . . . 9
Save as IFF . . . . . . . . . . . . . . . . . . . . 10
End (Amiga-Q) . . . . . . . . . . . . . . . . . . . 10
Edit . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Molecule data (Amiga-M) . . . . . . . . . . . . . . 10
Palette (Amiga-P) . . . . . . . . . . . . . . . . . 10
Paint . . . . . . . . . . . . . . . . . . . . . . . . . 11
Outlines (Amiga-O) . . . . . . . . . . . . . . . . 11
Calottes (Amiga-K) . . . . . . . . . . . . . . . . 11
Preferences . . . . . . . . . . . . . . . . . . . . . . 11
Y/X relation . . . . . . . . . . . . . . . . . . . 11
Icon for .CDM-files . . . . . . . . . . . . . . . . 11
Icon for IFF . . . . . . . . . . . . . . . . . . . 11
Title line . . . . . . . . . . . . . . . . . . . . 12
Hints for data selection . . . . . . . . . . . . . . . . . 12
Miscalleanous . . . . . . . . . . . . . . . . . . . . . . . 13
Revision History . . . . . . . . . . . . . . . . . . . . . 14
----------------------------------------------------------------------
Manual - 10/20 1991 2
Chemesthetics V2.10
----------------------------------------------------------------------
1 What is Chemesthetics
Chemesthetics, a symbiose of the words chemistry and esthetics
is a program that displays molecules as a calotte model. This
kind of display contains a certain esthetic attitude, even
extremely poisonous molecules like nicotine or dioxine look
quite nice.
In June 89 a program that did this called CDCHEM was published
in the c't computer magazine. It was written by Robert Kaufmann
in TurboPascal for an MS-DOS compatible. Unfortunately it had
two great disadvantages: the input of new data was extremly
uncomfortable, and of course, it was written for a PC (gualp!).
So I decided to re-write the program for the Amiga.
But it wasn't as easy as I had expected. Function calls in
Pascal are being done by 'call by reference' where as in C they
are processed by 'call by value'. I didn't like
pointer-arithmetic at this time very much, so I had some
difficulty in working this over.
Finally I was given the deciding kick by a program called P2C
that translates Pascal into C automatically. A totaly confusing
but *RUNNING* program was generated, but it was even more
uncomfortable than the original. So it took me another couple of
months and a lot of work to write a resonable user interface and
to make the program readable again.
2 Copyright, Distribution etc.
Chemesthetics V2.10 is copyrighted (C) 1991 Joerg Fenin /
Metalworx
The arp.library is (C) copyright AmigaDos Resource Project.
The palette requester is (C) copyright 1989 Jonathan Potter.
The req.library is (C) copyright 1989 Bruce Dawson & Colin Fox.
A lot of the example files have been taken from 'Molec3D' from
S. Albrecht and have been converted into Chemesthetics data
files.
Chemesthetics is Freeware, that means it may be copied or
distributed freely as long as the following rules are obeyed:
- The copyright-information remains unchanged
- The following files are distributed *TOGETHER*:
Chemesthetics (English version)
Chem_E.dat
Chemesthetics.doc
or
Chemesthetics (German version)
Chem_G.dat
----------------------------------------------------------------------
Manual - 10/20 1991 3
Chemesthetics V2.10
----------------------------------------------------------------------
Chemesthetics.doc
- The copying fee may not be more than DM 5,- rsp. not more
than $ 5 in the current currency in foreign (out of Germany)
countries (exeception: Fred Fish, he may charge more).
- None of the files listed above or the source file may be part
of a commercial product without the (written) permission of
the author.
Copying and/or distributing is forbidden on PD-series of Stefan
Ossowski PD-Versand, Rainer Wolf PD-Versand (OASE), Markt &
Technik Verlag AG and all other PD-distributors that charge more
than DM 5,- / $ 5,- for one disk.
After a call from Mr Schweitzer from the Karstadt AG Essen I
removed the restrictions for the Karstadt AG after he assured me
that, despite of the high copying fee, they are not making any
profit with the pd-disks. However, I recommend to compare prices
carefully.
As I am very lazy concerning donating money for freeware myself,
I don't expect to receive any donation for this program. However
I won't reject it; especially not from chemistry teachers.
For sending me DM 15,- / US$ 15 you can become a registered
user. After sending me the money you will recieve the latest
version (including serial number). Unfortunately I could not
send a printed manual anymore, 'cause I don't have access to a
laser printer anymore and I would not allow anyone to put up
with a printout by my last century nine needler. On the other
hand I reduced the registration fee down by DM 5,- / US $ 5,-.
(Since banks charge a high amount for foreign cheques the
registration fee is US$ 15, although it is (still) more than DM
15,-. Actually not much more than DM 15,- will be left from a
US$ 15,- cheque.)
The program may be ordered at:
Joerg Fenin
Zum Jaegerfeld 19
2100 Hamburg 90
Germany
3 Installation
Copy the Arp- and the req.library into your LIBS: drawer. That's
it!
(I know it's quite annoying to fill up your boot disk with two
libs but for the sake of a good user interface I decided to use
the file requester of the req.library. Even though it would have
----------------------------------------------------------------------
Manual - 10/20 1991 4
Chemesthetics V2.10
----------------------------------------------------------------------
been possible to skip the arp.library in this release because
just two routines are used of it (ArpAlloc, CloseWindowSafely),
I decided to leave in the program because it has so many
interesting routines, some of them I will certainly use in
future releases. From Version 2.06 onward I use the official
ILBM-writing-routine (ilbmw.c) from Commodore's IFF disk
(AmigaLibDisk #185), so that I could kick out iff.library (sorry
Christian, it really wasn't bad, it was faster than ilbmw.c, but
it was too much copying mess just for the one feature I used of
it.).
I hope most of the PD distributors will publish my package as a
whole. In that case you just have to click on the
'InstallLibs'-icons. All needed libraries will be copied to
libs: automatically.
3.1 Files
The following files are supplied (if not changed by some pd-
distributor) (.info files left out!):
Chemesthetics/
c/
IconX - used by the script files
LhArc - Version 1.30 of the file
compressor (needed to extract
Source.LZH)
MuchMore - Text displayer
Contents - small entry for the
AmigaLibDisk-contents file
English/
Chemesthetics - main executable (English)
Chemesthetics.doc - english documentation
Chems_g.dat - data file (includes atoms and
its colors), needed!
Examples/ - some example files
German/
Chemesthetics - main executable (German)
Chemesthetics.doc - German documentation
Chems_e.dat - data file (includes atoms and
its colors), needed!
Examples/ - some example files
Hints_for_Distributors - a few hints for those who would
like to include Chemesthetics
in a PD series
InstallLibs - small script that installs arp-
and req.library in the LIBS:
drawer
libs/
----------------------------------------------------------------------
Manual - 10/20 1991 5
Chemesthetics V2.10
----------------------------------------------------------------------
arp.library - nothing left to say
req.library - for the requesters
Pictures/ - Pictures made of the examples
Source/
SrcReadMe! - Some facts for programmers
Source.LZH - all needed source files
compressed into one archive
(use lharc to extract)
lmkfile - type lmk (Lattice users only)
for automatic compile and link,
copy it to the source root
directory
pdomain/
*.h - include files for the use of
the arp.library, req.library
and ilbm.w, you have to change
the -i directive in the lmkfile
to this directory for
successful compilation
*.c - C source files
*.h - includes for the above
convm3d/
*.c - source files for ConvM3D
lmkfile - type lmk (Lattice users only)
for automatic compile and link
4 How to use Chemesthetics
The basis for each molecule are atoms. A watermolecule for
example consists of one oxygen and two hydrogen atoms. The
position of the atoms must be told to the program as well as the
position of the light source, the twisting and the reflection of
the molecule.
Out of this data a calotte model of the molecule is calculated.
Entered data may be saved and restored for later use. A
completed picture can be saved as an IFF graphics file.
4.1 The entering of data
Select 'Molecule data' from the input menu.
A new window opens where you can enter the data. To do this
switch the edit gadget to ADD. The cursor appears in the first
of the input gadgets. Enter here the short sign of the atom, for
example O for oxygen. Press <RETURN> and the cursor jumps to the
next string gadget, the position field for the x-coordinate.
----------------------------------------------------------------------
Manual - 10/20 1991 6
Chemesthetics V2.10
----------------------------------------------------------------------
Enter 160 for example. Do this analogly for the coordinates for
Y and Z. Finally enter the radius for the atom. The radius
describes the size of the atom. The higher the radius the bigger
the atom. Size relationships of the atoms can be found in a
usual chemistry book.
The axises lay in space as follows:
^ _
z | /|
| / y
| /
|/
*-----> x
You'll find some examples in the .cdm-files.
Enter all atoms of a molecule one after another. The locations
of the atoms to each other can be also found in chemistry books.
In addition you'll find some examples on the disk. With "Project
- Load molecule" they may be loaded.
You can delete an atom by clicking on the 'DELETE' gadget in the
upper right corner. Therefore you have to select it first
(remember to set the mode-gadget to 'EDIT').
After entering all atoms, Chemesthetics needs some data
concerning the molecule as a whole:
The magnifiction factor (MagnFactor) expresses the magnification
of the whole molecule. A magnification facter of 1.0 leaves the
molecule unchanged, a magnification factor < 1.0 shrinks, a
magnification factor > 1.0 expands the molecule.
The following three values express the twisting of the molecule
in space. It may be twisted around any of the three axises.
Therefore enter the desired values in the string gadgets.
Now follow the values for the light source. Chemesthetics uses a
kind of ray tracing algorithm to create a three dimensional
appearance for the calotte model. Even shadowing is taken into
consideration. To do this a vector of the light source has to be
entered. A reasonable value is for example X=20000, Y=-100000,
Z=20000. All inputs are made in picometers (1 pm = 10-12
meters). All example molecules on the disk use this vector.
The last value that has to be entered, declares the relexion of
the atoms. The higher the reflection the stronger will the light
source be reflected in each atom. A value of 100 will reflect
the light like a mirror (i.e. the atom will appear white).
----------------------------------------------------------------------
Manual - 10/20 1991 7
Chemesthetics V2.10
----------------------------------------------------------------------
Is everything correct click on the OK-gadget, to cancel all
inputs click the CANCEL-gadget or the closegadget.
4.2 Display a molecule
You'll find two menuitems in the menu "Paint", i.e. 'Outline'
and 'Calottes'. If you select 'Outline' just a circle will be
painted for each atom. It gives you a quick survey how the
molecoule will look like. This mode gives you the chance to
experiment with different data (mostly twists) without having to
wait for hours just to see it's not what you wanted. Certainly
the stereoscopic effect may be lost.
If you are satisfied with all the values select 'Calottes'. The
molecule will be drawn considering all the data including light
and reflection. Because of the mass of data large molecules like
dioxine can take up to one hour until they are finished. But the
result compensates the efforts.
In order to get some information on how long you can spend some
time with your girl friend I provided the time-info window. It
will display the time taken so far for drawing and will
calculate an excepted end time for the drawing process after
each molecule. To keep calculation effort as low as possible it
will not be the exact result but it will become more exact after
each finished atom. See also ->Preferences... time-info window.
A calotte painting may be interrupted anytime by clicking on the
left mouse button.
4.3 Save a molecule
In the "Project" menu you'll find, among others, two
'save'-menuitems, i.e. 'Save molecule' and 'Save IFF'. Use the
first to save the molecule as a Chemsthetics datafile, it will
get, if not changed, the extension .cdm. As default an icon will
be saved along with the data file. You can turn this off in the
preferences.
With 'Save IFF' the screen will be saved as an IFF graphics
file. If 'Icon for IFF' was selected in the preferences menu an
icon will be saved along with the file.
----------------------------------------------------------------------
Manual - 10/20 1991 8
Chemesthetics V2.10
----------------------------------------------------------------------
5 Short menu overview
5.1 Copyright
Copyright-Information
5.1.1 Credits
Information about who supported the completion of this programm.
5.2 Project
Input and output functions
5.2.1 Load Mol (Amiga-L)
Opens the (great) file requester of the req.library (thanks to
Bruce & Colin) and loads, after selecting the name, the
corresponding molecule file. If Chemesthetics detects an error
in the data it will display a warning. In this case it is highly
recommended that you check the data by selecting
"Input...molecular data".
5.2.2 Save Mol (Amiga-S)
Opens the file requester and saves, after entering or selecting
the name, the current data as a Chemesthetics data file (.cdm).
As default a Project icon will be saved along with the data file
(with /Chemesthetics as it's tool). However Chemesthetics does
not (yet) recognize if it is launched via one of this icons. So
you still have to load a molecule manually. You can switch off
the icon creation in the preferencs.
5.2.3 new Mol (Amiga-N)
If you have a molecule in memory and you would like to load or
enter a new one, I recommend to delete the values for the old
molecule first. After a security verification, the values for
magnification and the light source will be set to their
defaults, all other values will be set to zero.
(Hint for the technical user: Due to using ArpAlloc() of the
arp.library for memory allocation, the used memory for the old
memory will not be released until the program terminates (the
arp.library will be closed). If you enter or load a new molecule
new memory will be allocated.)
----------------------------------------------------------------------
Manual - 10/20 1991 9
Chemesthetics V2.10
----------------------------------------------------------------------
5.2.4 Save as IFF
Saves the screen as an IFF file. This file may be read by any of
the current graphic programs (like DPaint or Butcher).
By default an icon will be saved along with the file. It will be
a PROJECT icon with 'C:IView' as the project's tool. See
'Preferences...Icon for IFF' to prevent icon creation.
Any IFF file will be compressed, using the official compression
algorithm provided by ilbmw.c from Commodore's official IFF disk
(AmigaLibDisk #185). I personally don't know any tool that does
not
work with this compression mode. However there are tools to
convert compressed files into uncompressed ones.
5.2.5 End (Amiga-Q)
Terminates the program.
5.3 Edit
Data input and color changing
5.3.1 Molecule data (Amiga-M)
The input window will be opened and, if present, the current
molecule data will be displayed in a list. You can scroll the
list with the arrows or the proportional gadget. The atom's data
may be changed if you click on an atom and the mode gadget is
switched to "EDIT". You can add new atoms to the molecule if you
switch the mode gadget to "ADD".
You can delete an atom after first selecting it (i.e. clicking
on it) and then click on the 'DELETE' gadget in the upper right
corner.
ATTENTION
: No security verfication will be made before
the deletion.
5.3.2 Palette (Amiga-P)
Here you can change all of the 16 colors of Chemesthetics.
Please note that most of the colors are used by Chemesthetics to
draw the atoms. The color distribution vastly corresponds with
Antropow's color distribution for atoms. You can restore
Chemesthetics' defaults by clicking on the "DEFAULT" gadget.
At this point I would like to thank Jonathan Potter for his
paletterequester.
----------------------------------------------------------------------
Manual - 10/20 1991 10
Chemesthetics V2.10
----------------------------------------------------------------------
5.4 Paint
Selection of the paint mode.
5.4.1 Outlines (Amiga-O)
Draws only the outlines of each atom. It serves as a quick
survey whether the entered data is right or wrong. Reflection,
shadowing etc. are not considered.
5.4.2 Calottes (Amiga-K)
Draws a calotte model considering ALL entered data. Because of
the mass of data it can take up to one hour or more to draw a
large molecule. By default a time-info window will be displayed
during the drawing process. It will show the time taken so far
by the drawing and the time still needed (approximately).
5.5 Preferences
Preferences of Chemesthetics
5.5.1 Y/X relation
Because of different screen resolutions in x- and y-direction,
circles usually appear as ellipses. The y/x relation value
corrects this. Chemesthetics automatically assumes a value of
1.5 for PAL screens (256 pixels in y-direction) and 2.0 for NTSC
screens (200 pixels in y-direction). However you could manually
overwrite this value.
5.5.2 Icon for .CDM-files
By default a PROJECT icon will be saved along with the data
file. It will have '/Chemesthetics' as it's default tool.
However, Chemesthetics currently does not recognise if it is
launched via one of theses icons or normally. So you still have
to load a datafile by hand. You can switch off icon creation for
data files if you want to.
5.5.3 Icon for IFF
Here you can decide whether an icon will be saved along with the
IFF graphics file (default) or not. The icon will be of type
PROJECT with 'C:IView' as its tool. If you copy IView (provided
for example on this disk, if this is an AmigaLibDisk) to the C:
----------------------------------------------------------------------
Manual - 10/20 1991 11
Chemesthetics V2.10
----------------------------------------------------------------------
drawer of your boot(hard)disk, you can easily view all the drawn
pictures by simply double-clicking on the icons.
5.5.4 Title line
In order to get more space for the drawing (especially important
on NTSC screens I guess), I switched off the menu line since
version 2.05. That means that you have to press the menu button
of your mouse (right mouse button) to get the program's menus.
However if you would like to have it there permanently you can
switch this gadget (and the menu line) on. Another click on this
gadget switches off the title line again.
5.5.5 Time-info window
To get an idea about how long a drawing will take, I provided
this info window during calotte painting. It will show the
following information:
Atom
Ss
:
uuu
/
xxx
time:
yyy.yy
min.
exepected time:
zzz.zz
min.
Ss
: short sign of the atom (e.g. O for Oxygen)
uuu
: current atom just drawn
xxx
: total number of atoms in molecule
yyy.yy
: time in minutes and seconds taken so far for drawing
zzz.zz
: expected total time for drawing process
If you don't want this window to show up switch off this gadget.
6 Hints for data selection
Most of the needed data may be extracted from simple chemistry
books. Calotte models are shown there very often. If they are
not too complex they may be taken over easily. Also the size
relationships between atoms are shown in tables or outlines, so
there is no need to guess. Another good source for atom data is
the shareware program Elements by Paul Miller located for
example on AmigaLibDisk 384.
To get a feeling for the data you could also have a look into
the example data files that (should) come with this program. You
could compare those data easily with the corresponding data in a
chemistry book. The water molecule for example can be found
almost every chemistry book.
May be I will release some more data files later on public
domain disks.
----------------------------------------------------------------------
Manual - 10/20 1991 12
Chemesthetics V2.10
----------------------------------------------------------------------
7 Miscalleanous
I would be very pleased to receive suggestions of any kind
(improvements, error reports etc.). If someone modifies the
source code I would like to receive a copy. Besides I am
interested in modifications concerning the new 5.0 Version of
the Aztec C Compiler.
Chemesthetics automatically recognises if it runs on a NTSC- or
PAL-machine.
This program has been written in C and has been compiled and
optimized under the SAS/Lattice C compiler V5.10a. It uses
routines of the arp.library (ArpAlloc(), CloseWindowSafely())
and the req.library (FileRequester(), SimpleRequest(),
TwoGadRequest(), SetLocation(), ReadLocation, SetSize()).
The program was tested under the following environment:
Amiga500
Kickstart 1.2
512 KByte RAM Extension
arp.library Version 39.1
req.library Version 2.5
----------------------------------------------------------------------
Manual - 10/20 1991 13
Chemesthetics V2.10
----------------------------------------------------------------------
8 Revision History
(sorted descending, the most recent version is at the top of the
list)
V2.10 - Oct 20 91 - removed terrible bug in memory management
in the main input routine
- added time-info window for time
statistics during the drawing process
- icons will now by default created for
data (.CDM) files
- added preferences items for 'icons for
.CDM-files' and 'time-info window'
- expanded the magnification gadget in the
input routine for two decimal places
V2.07 - 16.10.91 - third published version (becauese of a
bug, see below!)
- Memory for atoms is now requested
dynamically and not by a static array.
You can now have up to 500 atoms in one
molecule.
- During I/O operations the mousepointer is
changed into a waitpointer.
- Library calls are now made direct and not
with the amiga.lib gluecode (now using
#pragmas). This should make those calls
faster and more compact.
- For startup the catch.o code is used.
This means that certain software errors
may be trapped and caught, producing a
snapshot of the situation that leads to
the error. This snapshot file may be used
by the SAS/Lattice traceback utility tb
to get information about the exception.
- Due to a bug in the optimization process,
global optimzing has been switched off
for eingabe.c and palettereq.c. This
caused V2.06 to meditate when calling the
main input function or the palette
requster.
V2.06 - 13.06.91 - second published version
- Now using ilbmw.c from the official
Commodore IFF disk (AmigaLibDisk #185) to
do the IFF saving, as a result I kicked
out the iff.library (sorry Christian).
- Possibility to let an icon be created
automatically when an iff file is written
(default)
V2.05 - 29.04.91 - Switched off the menu line to get more
----------------------------------------------------------------------
Manual - 10/20 1991 14
Chemesthetics V2.10
----------------------------------------------------------------------
space for the drawings, i.e. you have to
use the menu button of your mouse to get
the menus. (could be turned on again in
the preferences menu)
- Changed the main window's type to
BACKDROP, that means that requesters
could not be put in the background
anymore, also it does not contain a title
line anymore to get a bit more room for
the drawings.
V2.04 - 21.04.91 - Implemented use of the req.library of
Bruce Dawson & Colin Fox. Now its file
requester is used instead of the one of
the arp.library. Also removed my own
MessageRequest() and exchanged it by the
related routines of the req.library
- Small window with the serial number will
be displayed on startup, detaches itself
after a few seconds if not closed by the
user
V2.03 - 13.04.91 - preferences window to set up y/x relation
and iff saving mode (actually because
there was a bug with the checkmark in the
preferences menu)
- fixed bug in SaveIFF (Chemesthetics
didn't take over the entered file name)
- changed colors to get a slight OS2.0
feeling
- drawing statistics (time and number of
atoms)
- removed some minor bugs
(This version became possible because the first (!,
not bad ?) registered user wrote in and asked for
the latest version. Actually the was no runnig
version at this time, so I had to sit down and did
some work to get it run again. Thanks Jim!)
V2.02 - 10.03.91 - recompiled under SAS/Lattice C 5.10a,
therefore some minor changes and
adaptions had to be done
- optimized run-time performance, drawings
are now ca. 30% faster
V2.01 - 17.02.91 - data is not linked into chip-mem
automatically anymore, instead
TypeOfMem() is used for graphics data to
decide wheter to transfer it into chip-
mem or if it is already there by
coincidence.
----------------------------------------------------------------------
Manual - 10/20 1991 15
Chemesthetics V2.10
----------------------------------------------------------------------
- editing of non existing atoms is not
longer possible
- editing is not longer possible when you
are in ADD-mode
- several minor changes
V2.00 - 27.12.90 - first published version
V1.00 - Spring 1990 - first running version
Chemesthetics V2.10 (C) 1990,1991 Metalwox, Manual update: 10/20 1991
----------------------------------------------------------------------
Manual - 10/20 1991 16