[comp.sys.mac.hypercard] Dynamic Cards?

postmaster@mailcom.UUCP (Bernard Aboba) (10/04/88)

I've been asked to write a HyperCard stack which would analyze an 
atmospheric pollution problem.  It's going to use a large xcmd written in 
MPW fortran, run a numerical simulation, and then draw contour maps of 
the output for display in HyperCard.  What I need to do is to be able to 
create COLOR cards with the contour maps drawn on them, so as to create 
an animation.
I have several questions:  Firstly, can one write XCMD's in MPW Fortran? 
I know that MPW C is a problem, but I have no idea whether MPW Fortran 
from Language Systems messes with register A5 or not.
Next, can one create a card dynamically and paint on the foreground 
easily?  In the background would be a map of the area or something.  
I also need to do the contour maps in COLOR.  I have the COLOR X-CMD, but 
that doesn't look too helpful here.
.
Am I trying to do something impossible?  The most irritating thing of all 
is that this is a piece of cake on the IBM PC, using software like 
Graphics FX, PC Storyboard, Graphix Designer, etc.  I'd appreciate any 
suggestions to help save my Mac Honor.


---
 * Origin: mailcom.Fidonet.org, This WAZOO's for you! Palo Alto (415) 855-9548 (Opus 1:204/444)
SEEN-BY: 204/444

--  
------------------------------------------------------------------------------
FidoNet:   1:204/444    UUCP: ...!sun!sunncal!mailcom!bernard
INTERNET:  sunncal!mailcom!bernard@Sun.COM
US MAIL:   Bernard Aboba, 101 First St. #224, Los Altos, CA 94022

dan@Apple.COM (Dan Allen) (10/04/88)

In article <4.2348DA08@mailcom.UUCP> postmaster@mailcom.UUCP (Bernard Aboba) writes:
>I have several questions:  Firstly, can one write XCMD's in MPW Fortran? 
>I know that MPW C is a problem, but I have no idea whether MPW Fortran 
>from Language Systems messes with register A5 or not.

MPW C can create XCMDs; there are just some constraints.  The same with
Fortran I suppose.  You SHOULD be able to, probably with less hassles
than with MPW C, but no one has ever tried it.  You will need to
translate the C stuff into Fortran...

>Next, can one create a card dynamically and paint on the foreground 
>easily?  In the background would be a map of the area or something.  

An XCMD can create cards on the fly without any program by just sending
a message back to HyperCard.  The background could be a map with the
foreground being specific.  No problem.

>I also need to do the contour maps in COLOR.  I have the COLOR X-CMD, but 
>that doesn't look too helpful here.

There are color XCMDs.  Working in color with HyperCard is a mixed
thing, since HyperCard does not provide native support for color images,
and won't for quite a while.  You CAN save gorgeous color images as
resources and use an XCMD to display, save, and restore images.

>Am I trying to do something impossible?  The most irritating thing of all 
>is that this is a piece of cake on the IBM PC, using software like 
>Graphics FX, PC Storyboard, Graphix Designer, etc.  I'd appreciate any 
>suggestions to help save my Mac Honor.

Well, if it IS so easy to do on a PC, then do it on a PC!  But I suspect
HyperCard offers lots of advantages that are VERY difficult to do on the
PC currently, so if this is true, all you have to do is a) convert the
XCMD stuff to work with Fortran and b) write some XCMDs to maintain
color images.

I would, of course, do it all in MPW C and/or Pascal because they
already work nicely with XCMDs, and they are just better languages in my
book.

Dan Allen
Apple Computer

beard@ux1.lbl.gov (Patrick C Beard) (10/05/88)

In article <4.2348DA08@mailcom.UUCP> postmaster@mailcom.UUCP (Bernard Aboba) writes:
>
>I've been asked to write a HyperCard stack which would analyze an 
>atmospheric pollution problem.  It's going to use a large xcmd written in 
>MPW fortran, run a numerical simulation, and then draw contour maps of 
>the output for display in HyperCard.  What I need to do is to be able to 
>create COLOR cards with the contour maps drawn on them, so as to create 
>an animation.
>I have several questions:  Firstly, can one write XCMD's in MPW Fortran? 

I don't know about this.  But I would assume so since the Language Systems
fortran is supposed to produce the exact same object as MPW Pascal.

>I know that MPW C is a problem, but I have no idea whether MPW Fortran 
>from Language Systems messes with register A5 or not.
>Next, can one create a card dynamically and paint on the foreground 
>easily?  In the background would be a map of the area or something.  

Yes, one can send a message from an XCMD to create a new card, you can
then place whatever bitmap (black & white only) you want on the card by
copybits'ing it to the desired rectangle while creating a picture,
putting the picture on the clipboard, and telling hypercard to paste it
on to the card.

>I also need to do the contour maps in COLOR.  I have the COLOR X-CMD, but 
>that doesn't look too helpful here.

Now, hypercard doesn't know anything about color.  Maybe the new version
will, so if you were to create a format 2 PICT above (with color), it would
paste it in black & white.  The only solution is to have the XCMD create
a color GrafPort and draw the map itself and maintain control for updates
etc.  I suppose the XCMD could call Hypercard's on idle handler?

>.
>Am I trying to do something impossible?  The most irritating thing of all 
>is that this is a piece of cake on the IBM PC, using software like 
>Graphics FX, PC Storyboard, Graphix Designer, etc.  I'd appreciate any 
>suggestions to help save my Mac Honor.
>
>

It seems to me that doing it in hypercard is going to be more difficult than
just writing a small application to do it.  Also, one suggestion I have is
that the XCMD should only be in charge of the display of the results of the
simulation, so write a down and dirty file oriented program to calculate the
simulation.  Write the XCMD in a language more suited for building code 
resources, i.e. C or Pascal (or ASM for that matter) and run the simulation 
in Fortran.

Until Hypercard can fully utilize the Macintosh's resources (color on the
Mac II), I don't think it is very useful for complicated applications.
(Flame on.)

Patrick Beard
Lawrence Berkeley Laboratory
beard@ux1.lbl.gov

beloin@batcomputer.tn.cornell.edu (Ron Beloin) (10/06/88)

In article <4.2348DA08@mailcom.UUCP> postmaster@mailcom.UUCP (Bernard Aboba) writes:
>
>I've been asked to write a HyperCard stack which would analyze an 
>atmospheric pollution problem.  It's going to use a large xcmd written in 
>MPW fortran, run a numerical simulation, and then draw contour maps of 
>the output for display in HyperCard.  What I need to do is to be able to 
>create COLOR cards with the contour maps drawn on them, so as to create 
>an animation.

You may be trying to do this in a way that is more difficult than it
really needs to be. As someone pointed out, the model could be a
separate application, called from hypercard, and the contour animation
might be another separate app. We are doing exactly this sort of thing
with a tree growth model. We use hypercard as a front end to aid the
user in setting up the model run correctly and to provide online
documentation. The model itself is a combination of Fortran and Pascal
using MPW, and finally there is a pascal program to display the results
in fancy color graphics. This works out nicely because the programs
can be launched from HC and we are not asking more of these development
systems than they can handle.
Also, I wanted to mention that a meteorologist here at Cornell has
developed a program that reads data files and generates animated
contour maps on Macs. It is called MacStorm and may be in the
Kinko's catalog by now. My understanding was that it could interpret
data of different kinds and generate the contours. A separate program
did the number crunching of the weather models and generated the data.
Send mail if you need his phone # or whatever.

BTW, Please let me know how your solution works out. It sounds like an
interesting problem.

Ron Beloin, Ecosystems Research Center, Corson Hall, Cornell, Ithaca,NY 14853
>> opinions << BITNET:BELOIN@CRNLTHRY; INTERNET:beloin@tcgould.tn.cornell.edu
>> are mine << UUCP:{cmcl2,shasta,uw-beaver,rochester}!cornell!tcgould!beloin