| Hi all (and Jean-Michel especially :-),
I don't know the mighty magician, but I can supply you with the kit's location,
if it's still there.
Drawn from TIMA:
DRAW_MAP. VMS/DECwindows tool producing backdrop maps for DECmcc 1.1
******************** CAUTION: FOR INTERNAL USE ONLY *********************
* *
* THIS INFORMATION IS FOR USE BY DIGITAL EQUIPMENT CORP. AND ITS *
* EMPLOYEES ONLY. PLEASE USE EXTREME CARE IF YOU MUST DISCUSS ANY *
* PART OF THIS INFORMATION WITH ANYONE WHO IS NOT A DIGITAL EMPLOYEE. *
* *
******************************************************************************
\\Product Set : VMSDP1
\\PFE : HSK03::HEISKANEN
\\Techn. Editor: TIMA::ARTICLE
\Article submitted by: PHILIPPE SERGE PETROU | 239159
CODE SAMPLE ARTICLE OUTLINE
------------------------------------------------------------------------------
BRIEF PROBLEM OUTLINE:
DECmcc EFT 1.1 uses backdrop maps described in ASCII files by Carthesis coor-
donates of polygones. As no classic drawing tool produces such data, DRAW_MAP
was created. It produces DECmcc usable files of DECwindows user's drawn maps.
PRODUCT: DRAW_MAP version 1.0
LAYERED PRODUCT: VAXC, VAX Fortran on VMS/DECwindows 5.3
DATE: 23-JAN-1991
OVERVIEW:
Problem... DECmcc backdrop maps are not easy to produce. DRAW MAP was
created to easily produce such map files.
Features.. Draw map has the following features:
1 Displaying a DECmcc map file
2 Displaying XBitMap file produced by DECpaint (or any other way...)
3 Creating a map by drawing polygones (see note below) in a window.
4 Saving map created map data in a new DECmcc map file
5 Scaling an old DECmcc map file so that it takes more or less space in the
navigation area. (Max scale in it is 5.0)
NOTE==> DECmcc toolbox allows you to put text and draw simple lines in maps, so
it was not used to manage this features in DRAW_MAP.
Who uses it... All person who wants to quickly produce DECmcc formatted
backdrop maps.
How to use it... Here below is a short user guide of Draw Map
1 Starting Draw Map
1-1 Prerequisite
Draw Map environment has the folowing caracteristics:
- A Xwindows terminal (Station, Xterminal...) supporting X11 standard as
DECwindows
- VMS/DECwindows operating system
- The following files in the same directory:
+ DRAW_MAP.EXE executable program
+ DRAW_MAP.DAT ressource file used by Draw Map at run time
+ DRAW_MAP.UID DECwindows interface description file
Remind: The ressource file of a DECwindows application is an editable file in
whitch you can modify some parameter of the interface (geometry,...)
1-2 Starting
Draw map may be run from File View (run option) or from DCL with the
following command:
$ RUN DRAW_MAP.EXE
In order to use the DRAW_MAP.DAT ressource file, the running process must have
DECW$USER_DEFAULTS search list pointing on draw map directory.
2 Displaying a DECmcc map
2-1 How to do
+ Choose option GET_MAP from GET_FILE submenu from FILE menu.
+ A file selection window appears. It contains (by default) all .DAT extensed
files of your current directory.
+ Select the DECmcc map file you want to display
+ Then drawmap reads this file and convert map data to Xlib format. When this
work is done, drawmap alarms you with a french message.
+ Finaly choose option DRAW_MAP from DRAW menu and the map should appear in
the work area holding all the offered space of the window.
2-2 The data file
The data file MUST be to DECmcc map data file format. (An example is given
below)
Anyway we have the following restrictions;
+ Draw map converts only object_type 4 data.
+ Draw map reads only 2000 points building a maximum of 200 polygones.
2-3 Common errors
During these oprations the following errors may occur:
+ Error opening the selected file (priviledges, bad file...)
+ Error in the file format (may occur in data reading or data converting
operations)
+ Rounding error
+ Array access error (access violation) if to much data
3 Displaying a XBitMap (XBM) model
3-1 How to do
+ Choose option GET_XBM from GET_FILE submenu from FILE menu.
+ A file selection window appears. It contains (by default) all .XBM extensed
files of your current directory.
+ Select the XBitMap file you want to display
+ Finaly choose option DRAW_XBM_MODEL from DRAW menu and the map should appear
in the work area.
3-2 The bitmap file
The bitmap file MUST be of XBitMap format as defined in X11 standard.
DECpaint uses this format when saving X11. An example of bitmap file is given
below.
3-3 Common error
During these oprations the following errors may occur:
+ Error opening the file
+ Server has not enough memory to store the bitmap.
4 Creating a DECmcc map and produce a new data file
4-1 How to do
+ Choose option CREATE_MAP from DRAW menu.
+ Then the working area cursor changes to DECwindows draw cursor, and the
mouse buttons get the following functions;
Button 1: + It stores the clicked point's coordonates and draw a line to the
last one (except in case of polygone begining).
Button 2: + It closes the current polygone, stores its number of points, and
allow you to start a new polygone
Button 3: + It ends the graphic recording
+ At this stage, data are in memory. you have to save them in a new file...
+ Choose option CREATE_FILE from SAVE_FILE submenu from FILE menu.
+ Then a dialog box appears, asking for the new file name and the scale factor
(REAL) you want to apply to new map data.
CARE==> THE SCALE FACTOR MUST BE ENTER IN REAL FORMAT.
4-2 Constraints
Here are the constraints to the acquisition:
+ The maximum number of points is a little less than 2000 (let say 1500...)
+ Scale factor must be real formatted (ex: 4.3) else...
5 Scaling a DECmcc map data
5-1 How to do
In order to change the space a map takes in DECmcc navigation area,
this option allows you to change the scale of the map.
To use it let's do the following:
+ Select option SCALE_FILE from submenu SAVE_FILE from menu FILE
+ Then a dialog box appears prompting you for;
- The source DECmcc map data file
- The file name to be created (it may be the same as source one =>
then drawmap create a new version)
- The new sacle factor (REAL)
5-2 Constraints
Scale MUST be a real data. For example: 3.0
6 Example of using
Context: I need a new map of France to put as background of my TIMA_France mcc
domain.
Solution:
+ I scan my favorit France map and then produce an image file (.IMG)
+ I read this file with DECpaint and scale the map in order to held it in a
picture size of about 500x500 pixels.
+ I save it as - X11 (XBitMap)
- <filename>.XBM
+ I quit DECpaint and start DRAW_MAP
+ Here I display my XBM model of France map
+ Then I create my France polygone
+ Finaly I save the new map in a file that I scale as I want.
+ Now I can use DECmcc with this new map and fullfill it with text, lines and
icons using DECmcc toolbox.
PROGRAM NOTES:
Where to find sources and executable:
A backup file located on VERS::DISK$KIT:[KIT.EMA.DECMCC.DRAWMAP]
It contains all needed files and 4 test files of France;
- TEST_FRANCE.IMG produced by scanning a France map.
- TEST_FRANCE.XBM produced by DECpaint from TEST_FRANCE.IMG (after scaling 25%)
- TEST_FRANCE.DAT produced by DRAW_MAP using TEST_FRANCE.XBM as XBM model and
creating a map scaled to 1.6
- MCC$_TIMA_FRANCE.DAT produced by DECmcc and inserting TEST_FRANCE.DAT data as
polygone.
This backup file names: DRAW_MAP.BCK and its listing is the following:
Listing of save set(s)
DRAW_MAP.C;1 34 23-JAN-1991 12:02
DRAW_MAP.COM;1 10 24-JAN-1991 14:45
DRAW_MAP.DAT;1 1 21-JAN-1991 16:19
DRAW_MAP.EXE;1 29 23-JAN-1991 12:03
DRAW_MAP.H;1 4 22-JAN-1991 19:53
DRAW_MAP.OBJ;1 13 23-JAN-1991 12:03
DRAW_MAP.PS;1 673 24-JAN-1991 17:41
DRAW_MAP.UID;1 48 22-JAN-1991 20:40
DRAW_MAP.UIL;1 24 22-JAN-1991 20:40
DRAW_MAP_CALLBACKS.C;1 31 23-JAN-1991 10:44
DRAW_MAP_CALLBACKS.OBJ;1 13 23-JAN-1991 10:45
DRAW_MAP_EXTERN.C;1 20 22-JAN-1991 20:17
DRAW_MAP_EXTERN.OBJ;1 10 22-JAN-1991 20:18
DRAW_MAP_GETFILE.FOR;1 10 21-JAN-1991 16:46
DRAW_MAP_GETFILE.OBJ;1 4 16-JAN-1991 17:17
DRAW_MAP_NEW_FILE_DAT.FOR;1 11 21-JAN-1991 16:48
DRAW_MAP_NEW_FILE_DAT.OBJ;1 6 15-JAN-1991 19:15
DRAW_MAP_SAVEMAP.FOR;1 6 21-JAN-1991 16:52
DRAW_MAP_SAVEMAP.OBJ;1 3 17-JAN-1991 19:17
MCC$_TIMA_FRANCE.DAT;3 12 24-JAN-1991 15:50
TEST_FRANCE.DAT;1 5 24-JAN-1991 15:54
TEST_FRANCE.IMG;2 3 24-JAN-1991 15:25
TEST_FRANCE.XBM;3 462 24-JAN-1991 15:46
Total of 22 files, 759 blocks
End of save set
Installing DRAW_MAP:
The application can run if the here above prerequisites are respected.
Anyway, you can rebuilt the executable file running the DCL procedure
DRAW_MAP.COM with the command:
$ @draw_map.com
This procedure makes all that the application needs to run.
Documentation:
A french documentation about this application exists in postscript form.
It describes the story of DRAW MAP, a user's guide, and the architecture of the
application.
PROGRAM SAMPLE:
Sample DECmcc backdrop map data file:
+------------------------------------------------------------------------------+
version 0
domain .mcc.TIMA_France
last_x 0.000000 last_y 0.000000
object_type 1
mcc_code 8
center_x 1.463825 center_y 1.068711
text_x 1.361954 text_y 0.989293
name .mcc.tima_ZTO
object_type 1
mcc_code 8
center_x 1.204990 center_y 1.275052
text_x 1.044907 text_y 1.193555
name .mcc.tima_UEO
object_type 4
count 56
0.870656 0.000000
0.972435 0.013368
0.944163 0.153361
0.989389 0.200022
:
:
0.571019 0.059984
0.684089 0.113357
0.870656 0.000000
object_type 2
var 1
width 0.008000
start_x 0.651455 start_y 1.278171
stop_x 0.897297 stop_y 1.134719
object_type 2
var 1
width 0.008000
start_x 0.428482 start_y 0.878482
stop_x 0.897297 stop_y 1.134719
object_type 7
text .mcc.tima_LFO
x 0.935551 y 1.414328
object_type 7
text Lille
x 0.983368 y 1.563410
[EOF]
Sample Xbitmap formatted file
+------------------------------------------------------------------------------+
#define TEST_width 50
#define TEST_height 50
#define TEST_x_hot 0
#define TEST_y_hot 0
static char TEST_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c,
0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xe0,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0xff, 0xff, 0xff,
0xff, 0xe3, 0x00, 0x1c, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x1c, 0xff,
0xff, 0xff, 0xff, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00,
0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80,
0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00,
0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c,
0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3,
0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00,
0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07,
0xfe, 0xfc, 0x81, 0xe3, 0x00, 0x1c, 0x07, 0x8c, 0x19, 0x83, 0xe3, 0x00,
0x1c, 0x07, 0x8c, 0x19, 0x83, 0xe3, 0x00, 0x1c, 0x07, 0x8c, 0x19, 0x83,
0xe3, 0x00, 0x1c, 0x07, 0xcc, 0x98, 0x81, 0xe3, 0x00, 0x1c, 0x07, 0x7c,
0xf8, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x0c, 0x18, 0x80, 0xe3, 0x00, 0x1c,
0x07, 0x0c, 0x18, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x3e, 0x7c, 0x80, 0xe3,
0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00,
0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07,
0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00,
0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80,
0xe3, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x80, 0xe3, 0x00, 0x1c, 0xff, 0xff,
0xff, 0xff, 0xe3, 0x00, 0x1c, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x1c,
0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xe0,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x00, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00};
Otherwise, try FRSOLD::ORCHIS::DISK$USER3:[EMA]DRAW_MAP.BCK.
However, keep in mind that this is for DECmcc V1.1! I don�t know if it still
works for V1.2. Anyway, I think it would be a good idea to further develop this
tool and mainly increase it's user friendliness. Any volunteers out there :-)?
Enjoy
Josch
|