aboutsummaryrefslogtreecommitdiff
path: root/src/graph/fileformats.pamphlet
blob: 87aee786351866074caf13123019280634eb20f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/graph fileformats }
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{The viewFile data file format}
The viewFile is a control file for graph information. It contains
settings for particular graphs. There are some general window
settings that apply to the whole graph window followed by 9
graph settings, one for each possible graph shown.
\subsection{The viewType}
The viewType (A) is a switch used to decide what tool will be used to
display the graph. At present there are 4 values defined (in the
file [[src/graph/include/action.h]]) which are:
\begin{verbatim}
/* Viewport Types */
#define view3DType     1
#define viewGraphType  2
#define view2DType     3
#define viewTubeType   4
\end{verbatim}
In the example below the integer value is '3', at (A), 
therefore it is of 'view2DType' meaning a 2D graph.

This value is read in [[src/graph/viewAlone/viewAlone.c]]
\subsection{The title}
The title, at (B), is read in [[src/graph/viewAlone/spoon2D.c]].
It can be a maximum of 256 characters.
\subsection{The window boundaries}
There are 4 integers, at (C), the X, Y, Width, and Height
which represent the window size in pixels.
\subsection{The graph specifications}
There are, at (D), a series of specifications for the 9
possible graphs. They are all in groups of 6 lines, one
per graph. These lines are stored in a data structure called
the [[graphArray]] or the [[graphStateArray]]. The lines are:
\begin{list}{}
\item D1 is either an integer value 0 or 1 (\%d format). 
If the value is zero the rest of the information is ignored and 
the graph is not displayed. If the value is 1 then the graph is 
displayed. This information is stored in [[graphArray[i].key]].
\item D2 are 2 C general numbers (\%g format). They represent
the scale factors in X and Y. This information is stored in
[[graphStateArray[i].scaleX]] and [[graphStateArray[i].scaleY]].
\item D3 are 2 C general numbers (\%g format). They represent 
the change in X and Y increments. This information is stored in
[[graphStateArray[i].deltaX]] and [[graphStateArray[i].deltaY]].
\item D4 are 2 C general numbers (\%g format). They represent the
center for the X and Y axes. This information is stored in
[[graphStateArray[i].centerX]] and [[graphStateArray[i].centerY]].
\item D5 are 7 integers (\%d format). They represent:
\begin{list}{}
\item pointsOn - 0 means no points, 1 means plot points.
Stored in [[graphStateArray[i].pointsOn]].
\item connectOn - 0 means isolated points, 1 means connected points.
Stored in [[graphStateArray[i].connectOn]].
\item splineOn - 0 means no spline, 1 means spline.
Stored in [[graphStateArray[i].splineOn]].
\item axesOn - 0 means no axes, 1 means draw axes.
Stored in [[graphStateArray[i].axesOn]].
\item axesColor - 0 means black and white, 1 means color.
Stored in [[graphStateArray[i].axesColor]].
\item unitsOn - 0 means no tick marks (units), 1 means units.
Stored in [[graphStateArray[i].unitsOn]].
\item unitsColor - 0 means black and white, 1 means color.
Stored in [[graphStateArray[i].unitsColor]].
\end{list}
\item D6 are 2 C integers (\%d format). 
\begin{list}{}
\item showing - 0 means the graph is hidden, 1 means showing.
Stored in [[graphStateArray[i].showing]].
\item selected - 0 means not selected, 1 means selected.
Stored in [[graphStateArray[i].selected]].
\end{list}
\end{list}
\begin{verbatim}
3                                          (A)
x*x                                        (B)
0 0 400 400                                (C)
1                                          (D1) (graph0)
0.867014 0.575432                          (D2)
0 0                                        (D3)
0 0                                        (D4)
1 1 1 1 61 1 68                            (D5)
1 1                                        (D6)
0                                               (graph1)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph2)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph3)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph4)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph5)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph6)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph7)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0                                               (graph8)
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
\end{verbatim}
\section{The graph file format}
There are up to 9 files, named [ [[graph0]] .. [[graph8]] ].
There is one file per graph as indicated by the [[data]] file above.
\subsection{The bounding values}
There are 4 integers (\%d format) at (A) giving the xmin, ymin, xmax, and
ymax values for the graph. These are stored in
[[graphArray[i].xmin]], [[graphArray[i].ymin]], [[graphArray[i].xmax]],
and [[graphArray[i].ymax]].

There are 2 general numbers (\%g format) at (B)
giving the xNorm and yNorm values. These are stored in
[[graphArray[i].xNorm]] and [[graphArray[i].yNorm]].

There are 2 general numbers (\%g format) at (C) 
giving the X origin and Y origin values. These are stored in
[[graphArray[i].originX]] and [[graphArray[i].originY]].

There are 2 general numbers (\%g format) at (D)
giving the X units and Y units from Axiom. These are stored in
[[graphArray[i].spadUnitX]] and [[graphArray[i].spadUnitY]].

There are 2 general numbers (\%g format) at (E)
giving the X units and Y units in graph coordinates. These are stored in
[[graphArray[i].unitX]] and [[graphArray[i].unitY]].

There is 1 integer (\%d format) at (F)
giving the number of lists that make up the graph. This is stored in
[[graphArray[i].numberOfLists]]. 

For each list, and in this case there is only 1 list. Each list
is stored in a [[pointListStruct]] pointed to by [[aList]].
In this case we have:
\begin{list}{}
\item (G) is the number of points in the list. This is 1 integer
(\%d format). It is stored in [[aList->numberOfPoints]].
\item (H) is 3 integers (\%d format) which represent the point color,
the line color, and the point size. These are stored in
[[aList->pointColor]], [[aList->lineColor]], and [[aList->pointSize]].
\item (I) is 4 general numbers (\%g format) which represent the
x, y, hue, and shade of a point. These are stored in a structure
called [[aPoint]] which consists of
[[aPoint->x]],[[aPoint->y]],[[aPoint->hue]], and [[aPoint->shade]].
These are pointed to by the [[aList]] structure. There are as many
copies of this data as there are points in the graph (G)
\end{list}

\begin{verbatim}
-3 0 3 9                           (A)  
0.166667 0.111111                  (B)
1.49012e-08 -0.5                   (C)
1.2 1.8                            (D)
0.2 0.2                            (E)
1                                  (F)
49                                 (G)
91 135 3                           (H)
-0.5 0.5 0 2                       (I) repeated (G) times
-0.479167 0.418403 0 2
-0.458333 0.340278 0 2
-0.4375 0.265625 0 2
-0.416667 0.194444 0 2
-0.395833 0.126736 0 2
-0.375 0.0625 0 2
-0.354167 0.00173611 0 2
-0.333333 -0.0555556 0 2
-0.3125 -0.109375 0 2
-0.291667 -0.159722 0 2
-0.270833 -0.206597 0 2
-0.25 -0.25 0 2
-0.229167 -0.289931 0 2
-0.208333 -0.326389 0 2
-0.1875 -0.359375 0 2
-0.166667 -0.388889 0 2
-0.145833 -0.414931 0 2
-0.125 -0.4375 0 2
-0.104167 -0.456597 0 2
-0.0833333 -0.472222 0 2
-0.0625 -0.484375 0 2
-0.0416667 -0.493056 0 2
-0.0208333 -0.498264 0 2
1.49012e-08 -0.5 0 2
0.0208333 -0.498264 0 2
0.0416667 -0.493056 0 2
0.0625 -0.484375 0 2
0.0833334 -0.472222 0 2
0.104167 -0.456597 0 2
0.125 -0.4375 0 2
0.145833 -0.414931 0 2
0.166667 -0.388889 0 2
0.1875 -0.359375 0 2
0.208333 -0.326389 0 2
0.229167 -0.289931 0 2
0.25 -0.25 0 2
0.270833 -0.206597 0 2
0.291667 -0.159722 0 2
0.3125 -0.109375 0 2
0.333333 -0.0555556 0 2
0.354167 0.00173611 0 2
0.375 0.0625 0 2
0.395833 0.126736 0 2
0.416667 0.194444 0 2
0.4375 0.265625 0 2
0.458333 0.340278 0 2
0.479167 0.418403 0 2
0.5 0.5 0 2
\end{verbatim}
\section{The parabola}
<<data>>=
3
x*x
0 0 400 400
1
0.867014 0.575432
0 0
0 0
1 1 1 1 61 1 68
1 1
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
0
0.9 0.9
0 0
0 0
1 1 0 1 0 0 0
0 0
@
<<graph0>>=
-3 0 3 9
0.166667 0.111111
1.49012e-08 -0.5
1.2 1.8
0.2 0.2
1
49
91 135 3
-0.5 0.5 0 2
-0.479167 0.418403 0 2
-0.458333 0.340278 0 2
-0.4375 0.265625 0 2
-0.416667 0.194444 0 2
-0.395833 0.126736 0 2
-0.375 0.0625 0 2
-0.354167 0.00173611 0 2
-0.333333 -0.0555556 0 2
-0.3125 -0.109375 0 2
-0.291667 -0.159722 0 2
-0.270833 -0.206597 0 2
-0.25 -0.25 0 2
-0.229167 -0.289931 0 2
-0.208333 -0.326389 0 2
-0.1875 -0.359375 0 2
-0.166667 -0.388889 0 2
-0.145833 -0.414931 0 2
-0.125 -0.4375 0 2
-0.104167 -0.456597 0 2
-0.0833333 -0.472222 0 2
-0.0625 -0.484375 0 2
-0.0416667 -0.493056 0 2
-0.0208333 -0.498264 0 2
1.49012e-08 -0.5 0 2
0.0208333 -0.498264 0 2
0.0416667 -0.493056 0 2
0.0625 -0.484375 0 2
0.0833334 -0.472222 0 2
0.104167 -0.456597 0 2
0.125 -0.4375 0 2
0.145833 -0.414931 0 2
0.166667 -0.388889 0 2
0.1875 -0.359375 0 2
0.208333 -0.326389 0 2
0.229167 -0.289931 0 2
0.25 -0.25 0 2
0.270833 -0.206597 0 2
0.291667 -0.159722 0 2
0.3125 -0.109375 0 2
0.333333 -0.0555556 0 2
0.354167 0.00173611 0 2
0.375 0.0625 0 2
0.395833 0.126736 0 2
0.416667 0.194444 0 2
0.4375 0.265625 0 2
0.458333 0.340278 0 2
0.479167 0.418403 0 2
0.5 0.5 0 2
@
<<*>>=
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}