Reference section

In this section you can find the list of all the user commands (and some functions that you are less likely to need) that you are going to need to visualize and steer you programs.

In table 1 you find functions that tell the GUI what kind of data is available to be visualized. The general notation contains Nx...xN_Rx...xR where the number of N indicate the dimensionality of the data array and the number of R indicate the dimensionality of the vector output. While there are a large number of possible combination, only a few are easily visualized, and special visualizations are implemented for each data type.

The second part of this table contains some default values that you can associate with each data type defined after calling these default functions. Currently these apply only to data types represented by curve2d_. The options that you can use here are listed in table 2.

Lastly there is the possibility of separating out different graph sections. This can be useful if you have too many data to be represented in the menu of one graph window. In these cases you can define new graphs structures, and the graphics windows refere to the data given by the current active graph.


Table 1: All commands used to register data that you want to visualize
function description
DefineGraphN_R(char *Name,double *gd,int *dim,int *req) Simple one dimensional arrays
DefineGraphN_RxR(char *Name,double *gd,int *dim,int *req) One dimensional arrays of points (x,y).
DefineGraphN_RxRp(char *Name,double **gd,int *dim,int *req) Pointer to an one dimensional array of points. Needed if the size of the data field will be resized with realloc().
DefineGraphNxN_R(char *Name,double *gd, int *dim1,int *dim2,int *req) Two dimensional array.
DefineGraphNxN_RxR(char *Name,double *gd, int *dim1,int *dim2,int *req) Two dimensional array of vectors.
DefineGraphNxN_RxRxRt(char *Name,double *gd, int *dim1,int *dim2,int *req) Three dimensional field. Still waiting for the implementation of the 3 dimensional contour.
DefineGraphContour3d(char *Name,Contour **gd, int *dim1,int *dim2,int *dim3,int *req) A special data type to define contour, especially from a parallel program.
  In the DefineGraphXXX routines the last argument *req can be a NULL pointer if the data do not need to be recalculated.
SetDefaultColor(int c) Default color for graphs defined after this command. See Table 2.
SetDefaultLineType(int s) Default line type is 1 (solid line). 0 means no line.
SetDefaultShape(int s) Default shape according to table 2.
SetDefaultSize(double s) Default size is one.
SetDefaultFill(int f) Default fill is off (0).
NewGraph() Start a new set of graphs.
SetActiveGraph(int) Set this before you call DefineGraph().



Table 2: Shapes and standard colors. Colors will be translated soon.
Name value
NoShape 0
UpTriangle 1
DownTriangle 2
Square 3
Circle 4
Color functions English
schwarz() black
weiss() white
rot() red
gruen() green
blau() blue
gelb() yellow



Table 3: Menu commands
Function description
StartMenu(char *Name,int installed) Start a new menu with name Name. It will be visible as you start the program if installed is 1
StartBoolMenu(char *Name,int *b) This will also start a menu, but the menu is also a Boolean field (see below) with name Name and address *b. To change the value of b left click the button, to open the menu right click the button.
EndMenu() Each menu has to be terminated by an EndMenu() command.
DefineInt(char *Name,int *myint) Menu item of type int
DefineLong(char *Name,long *myint) Menu item of type long
DefineMod(char *Name,int *myint,int mod) Menu item of type int. The value is constraint to be between 0 and mod-1
DefineBool(char *Name,int *myint) Integer that can only take the values 0 and 1. In the menu this is represented as ``off'' and ``on'' respectively.
DefineDouble(char *Name,double *mydouble) Menu item of type double
DefineFloat(char *Name,float *myfloat) Menu item of type float
DefineString(char *Name,char *s,int maxlen) Menu item for a string with maximum length maxlen. There is a bug that still allows you to write strings longer than maxlen.
DefineFunction(char *Name,fp myfp) This function allows you to call a function. This function may not have an argument.
DefineItem(int vartype) This is a function to add special items like the print button (print_ and dopint_), a close button (close_) or a Redraw button (newdraw_). You will probably not need to use these except maybe the close_ option.
DefineGraph(int vartype, char *Name) Adding buttons for different kinds of graphics with arguments given by table 5.



Table 4: Different options for the DefineGraph() routine.
Type numerical value description
curve2d_ 11 displays N_R,N_RxR, and N_RxRp data types as two dimensional curves.
contour2d_ 9 displays NxN_R data types as density and contour plots and NxN_RxR data types as vector plots.
graph2d_ 8 displays NxN_R data types as three dimensional graphs.
contour3d_ 10 displays NxNxN_R data types as three dimensional contour plots. Not yet fully implemented.
freedraw_ 25 Displaying the output of graphics routines you have written yourself, and have defined through AddFreedraw() (see Table 5).



Table 5: Commands used for freedraw graphics routines.
function description
AddFreedraw(char *name, FrDr FreeDraw) Define a drawing function that you defined yourself of type void Name(int xdim,int ydim). The size of the window you are drawing in is xdim,ydim. Note that these values change, as the user resizes the window.
mydrawline(int color, int x1, int y1, int x2, int y2) Draws a line between the points $(x_1,y_1)$ and $(x_2,y_2)$.
mypolygon(int color, XPoint *points, int n) Draws a filled polygon of n XPoints
mypolygon_line(int col, int colLine, XPoint *points, int n) Drasw a filled polygon of color col with an outline of color colLine.
mylinepolygon(int col, XPoints *points, int n) As above, but only draws the outline.
mycircle(int col, int x, int y, int r) Draws a circle around the point (x,y) with radius r in color col.
myfilledcircle(int col, int x, int y, int r) Draws a filled circle around the point (x,y) with radius r in color col.
mytext(int col, int x, int y, char *text, int orient) Draws the string text at position x with orientation 1:centered, 2:right, or left for all other values.
myselectfont(int font, char *testtext, double length) Has to be called before the first mytext command! It selects a font such that the string will have approximately the length length. The first variable selects the kind of font, and should be set to 0 for now.


Alexander Wagner 2016-01-14