The only really tricky part about using POW from TCL is getting a pointer
to your data passed to it.  This must be done through the clientData argument
when you call Tcl_CreateCommand for whatever command is going to read the 
data.  The file readpha.c is an example in the current POW distribution. 

The routine for the command that's going to create/read the data 
will have the standard look for a TCL command written in C:

#include "pow.h"

int readpha(ClientData clientData, Tcl_Interp *interp,           
	      int argc, char *argv[]) {                          

Now define a pointer to pointer to use to do the "pointer pass":

int **databuff

You'll also presumably have a pointer to the actual data you want
to "create" in POW:

void *imagebuff

Now do whatever you need to to get imagebuff to point at the array you
want to "create" in POW, and then:

databuff = clientData;                                                 
*databuff = (int *)imagebuff;                                         

You probably want to have your TCL command return the things
that powCreateData is expecting (i.e. a data type and the number of
elements in the array, something like:

sprintf(interp->result,"%i %i", array_type, width*height);

array type can be either a string or an integer:


BYTE          0 
SHORTINT      1
INT           2
REAL          3
DOUBLE        4 


You can now do:

eval [concat powCreateData mydata [readpha filename]]

So the high level TCL commands which work now are:


%powCreateData data_name data_type length

%powCreateImage image_name data_name xoffset yoffset width height xorigin xinc yorigin yinc xunits yunits zunits

%powCreateGraph graph_name curves images xunits yunits xlabel ylabel xdimdisp ydimdisp

There are actually more, but they can all be accessed through the POW GUI,
so I'm not going to describe them right now.




