1 | View |
---|
2 | |
---|
3 | Rp_View *Rp_ViewInit(const char *name, size_t rows, size_t cols); |
---|
4 | void Rp_ViewDestroy (Rp_View *v); |
---|
5 | |
---|
6 | const char *Rp_ViewGetName(Rp_View *v) const; |
---|
7 | void Rp_ViewSetName(Rp_View *v, const char *val); |
---|
8 | |
---|
9 | const char *Rp_ViewGetPath(Rp_View *v) const; |
---|
10 | void Rp_ViewSetPath(Rp_View *v, const char *val); |
---|
11 | |
---|
12 | const char *Rp_ViewGetLabel(Rp_View *v) const; |
---|
13 | void Rp_ViewSetLabel(Rp_View *v, const char *val); |
---|
14 | |
---|
15 | const char *Rp_ViewGetDesc(Rp_View *v) const; |
---|
16 | void Rp_ViewSetDesc(Rp_View *v, const char *val); |
---|
17 | |
---|
18 | const char *Rp_ViewGetHints(Rp_View *v) const; |
---|
19 | void Rp_ViewSetHints(Rp_View *v, const char *val); |
---|
20 | |
---|
21 | const char *Rp_ViewGetColor(Rp_View *v) const; |
---|
22 | void Rp_ViewSetColor(Rp_View *v, const char *val); |
---|
23 | |
---|
24 | const void *Rp_ViewGetProperty (Rp_View *v, const char *key) const; |
---|
25 | void Rp_ViewSetProperty (Rp_View *v, const char *key, |
---|
26 | const void *val, size_t nbytes); |
---|
27 | |
---|
28 | const char *Rp_ViewGetPropStr (Rp_View *v, const char *key) const; |
---|
29 | void Rp_ViewSetPropStr (Rp_View *v, const char *key, const char *val); |
---|
30 | |
---|
31 | void Rp_ViewPropRemove (Rp_View *v, const char *key); |
---|
32 | |
---|
33 | void Rp_ViewVValue(Rp_View *v, void *storage, size_t numHints, |
---|
34 | va_list arg) const; |
---|
35 | void Rp_ViewRandom(); |
---|
36 | Rp_Chain *Rp_ViewDiff(Rp_View *v); |
---|
37 | |
---|
38 | void Rp_ViewConfigure(Rp_View *v, size_t as, ClientData c); |
---|
39 | void Rp_ViewDump(Rp_View *v, size_t as, ClientData c); |
---|
40 | |
---|
41 | Outcome *Rp_ViewOutcome(Rp_View *v) const; |
---|
42 | |
---|
43 | const int Rp_ViewIs(Rp_View *v) const; |
---|
44 | |
---|
45 | void Rp_ViewPlot(Rp_View *v, const char *name, size_t row, size_t col, |
---|
46 | Rp_TableColumn *x, Rp_TableColumn *y, const char *style); |
---|
47 | void Rp_ViewSurf2D(Rp_View *v, const char *name, size_t row, size_t col, |
---|
48 | Rp_TableColumn *x, Rp_TableColumn *y, Rp_TableColumn *data); |
---|
49 | void Rp_ViewSurf3D(Rp_View *v, const char *name, size_t row, size_t col, |
---|
50 | Rp_TableColumn *x, Rp_TableColumn *y, Rp_TableColumn *z, Rp_TableColumn *data); |
---|
51 | void Rp_ViewImage(Rp_View *v, Rp_Image *img, size_t row, size_t col); |
---|
52 | void Rp_ViewNote(Rp_View *v, Rp_Note *note, size_t row, size_t col); |
---|
53 | |
---|
54 | |
---|
55 | --------------------------------------- |
---|
56 | Rp_View *Rp_ViewInit(const char *name, size_t rows, size_t cols); |
---|
57 | Purpose: construct a view for displaying data |
---|
58 | Input Arguments: 1 required, 2 optional |
---|
59 | 1. name - name of the view |
---|
60 | 2. rows - number of rows in the view |
---|
61 | 3. cols - number of columns in the view |
---|
62 | Return Value: a newly created, empty view object |
---|
63 | Notes: None |
---|
64 | Code Example: |
---|
65 | {{{ |
---|
66 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
67 | }}} |
---|
68 | |
---|
69 | void Rp_ViewDestroy (Rp_View *v); |
---|
70 | Purpose: destroy a view object |
---|
71 | Input Arguments: 1 required |
---|
72 | 1. v - pointer to view object to destroy |
---|
73 | Return Value: None |
---|
74 | Notes: None |
---|
75 | Code Example: |
---|
76 | {{{ |
---|
77 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
78 | Rp_ViewDistroy(v); |
---|
79 | v = NULL; |
---|
80 | }}} |
---|
81 | |
---|
82 | |
---|
83 | const char *Rp_ViewGetName(Rp_View *v) |
---|
84 | Purpose: get the id name of the object |
---|
85 | Input Arguments: 1 |
---|
86 | 1. Rp_View *v - pointer to View object |
---|
87 | Return Value: the id name stored in the object. |
---|
88 | Notes: if no name is set, NULL will be returned |
---|
89 | the id name is used to identify this object from |
---|
90 | all other objects and should be unique |
---|
91 | Code Example: |
---|
92 | {{{ |
---|
93 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
94 | printf("name = %s\n", Rp_ViewGetName(v)); |
---|
95 | |
---|
96 | // The string: |
---|
97 | // name = fdfplots |
---|
98 | // is printed to the stdout. |
---|
99 | }}} |
---|
100 | |
---|
101 | void Rp_ViewSetName(Rp_View *v, const char *val) |
---|
102 | Purpose: set the id name of the object |
---|
103 | Input Arguments: 2 |
---|
104 | 1. Rp_View *v - pointer to View object |
---|
105 | 2. const char *val - new id name |
---|
106 | Return Value: None |
---|
107 | Notes: a copy of the memory location val will be stored |
---|
108 | Code Example: |
---|
109 | {{{ |
---|
110 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
111 | |
---|
112 | Rp_ViewSetName(v, "newPlots"); |
---|
113 | printf("name = %s\n", Rp_ViewGetName(v)); |
---|
114 | |
---|
115 | // The string: |
---|
116 | // name = newPlots |
---|
117 | // is printed to the stdout. |
---|
118 | }}} |
---|
119 | |
---|
120 | const char *Rp_ViewGetPath(Rp_View *v) |
---|
121 | Purpose: get the path of the object |
---|
122 | Input Arguments: 1 |
---|
123 | 1. Rp_View *v - pointer to View object |
---|
124 | Return Value: the path stored in the object. |
---|
125 | Notes: if no path is set, NULL will be returned |
---|
126 | the path tells where this object sits in the |
---|
127 | hierarchy of objects. |
---|
128 | Code Example: |
---|
129 | {{{ |
---|
130 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
131 | |
---|
132 | printf("path = %s\n", Rp_ViewGetPath(v)); |
---|
133 | |
---|
134 | // The string: |
---|
135 | // path = |
---|
136 | // is printed to the stdout. |
---|
137 | }}} |
---|
138 | |
---|
139 | void Rp_ViewSetPath(Rp_View *v, const char *val) |
---|
140 | Purpose: set the path of the object |
---|
141 | Input Arguments: 2 |
---|
142 | 1. Rp_View *v - pointer to View object |
---|
143 | 2. const char *val - new path |
---|
144 | Return Value: None |
---|
145 | Notes: a copy of the memory location val will be stored |
---|
146 | Code Example: |
---|
147 | {{{ |
---|
148 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
149 | |
---|
150 | printf("path = %s\n", Rp_ViewGetPath(v)); |
---|
151 | Rp_ViewSetPath(v, "output"); |
---|
152 | printf("path = %s\n", Rp_ViewGetPath(v)); |
---|
153 | |
---|
154 | // The strings: |
---|
155 | // path = |
---|
156 | // path = output |
---|
157 | // are printed to the stdout. |
---|
158 | }}} |
---|
159 | |
---|
160 | const char *Rp_ViewGetLabel(Rp_View *v) |
---|
161 | Purpose: get the label of the object |
---|
162 | Input Arguments: 1 |
---|
163 | 1. Rp_View *v - pointer to View object |
---|
164 | Return Value: the label stored in the object. |
---|
165 | Notes: if no label is set, NULL will be returned |
---|
166 | the label is used by the graphical user interface. |
---|
167 | Code Example: |
---|
168 | {{{ |
---|
169 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
170 | |
---|
171 | printf("label = %s\n", Rp_ViewGetLabel(v)); |
---|
172 | |
---|
173 | // The string: |
---|
174 | // label = |
---|
175 | // is printed to the stdout. |
---|
176 | }}} |
---|
177 | |
---|
178 | void Rp_ViewSetLabel(Rp_View *v, const char *val) |
---|
179 | Purpose: set the label of the object |
---|
180 | Input Arguments: 2 |
---|
181 | 1. Rp_View *v - pointer to View object |
---|
182 | 2. const char *val - new label |
---|
183 | Return Value: None |
---|
184 | Notes: a copy of the memory location val will be stored |
---|
185 | Code Example: |
---|
186 | {{{ |
---|
187 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
188 | |
---|
189 | printf("label = %s\n", Rp_ViewGetLabel(v)); |
---|
190 | Rp_ViewSetLabel(v, "Fermi-Dirac Factor"); |
---|
191 | printf("label = %s\n", Rp_ViewGetLabel(v)); |
---|
192 | |
---|
193 | // The strings: |
---|
194 | // label = |
---|
195 | // label = Fermi-Dirac Factor |
---|
196 | // are printed to the stdout. |
---|
197 | }}} |
---|
198 | |
---|
199 | const char *Rp_ViewGetDesc(Rp_View *v) |
---|
200 | Purpose: get the description of the object |
---|
201 | Input Arguments: 1 |
---|
202 | 1. Rp_View *v - pointer to View object |
---|
203 | Return Value: the description stored in the object. |
---|
204 | Notes: if no description is set, NULL will be returned |
---|
205 | the description is used by the graphical user |
---|
206 | interface to describe what type of data is being |
---|
207 | requested and how the input is used. |
---|
208 | Code Example: |
---|
209 | {{{ |
---|
210 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
211 | |
---|
212 | printf("desc = %s\n", Rp_ViewGetDesc(v)); |
---|
213 | |
---|
214 | // The string: |
---|
215 | // desc = |
---|
216 | // is printed to the stdout. |
---|
217 | }}} |
---|
218 | |
---|
219 | void Rp_ViewSetDesc(Rp_View *v, const char *val) |
---|
220 | Purpose: set the description of the object |
---|
221 | Input Arguments: 2 |
---|
222 | 1. Rp_View *v - pointer to View object |
---|
223 | 2. const char *val - new description |
---|
224 | Return Value: None |
---|
225 | Notes: a copy of the memory location val will be stored |
---|
226 | Code Example: |
---|
227 | {{{ |
---|
228 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
229 | |
---|
230 | printf("desc = %s\n", Rp_ViewGetDesc(v)); |
---|
231 | Rp_ViewSetDesc(v, "A plot of the Fermi-Dirac Factor"); |
---|
232 | printf("desc = %s\n", Rp_ViewGetDesc(v)); |
---|
233 | |
---|
234 | // The strings: |
---|
235 | // desc = |
---|
236 | // desc = A plot of the Fermi-Dirac Factor |
---|
237 | // are printed to the stdout. |
---|
238 | }}} |
---|
239 | |
---|
240 | const char *Rp_ViewGetHints(Rp_View *p) |
---|
241 | Purpose: get the hints of the object |
---|
242 | Input Arguments: 1 |
---|
243 | 1. Rp_View *v - pointer to View object |
---|
244 | Return Value: the hints stored in the object. |
---|
245 | Notes: if no hints are set, NULL will be returned |
---|
246 | the hints are used by the graphical user interface |
---|
247 | Code Example: |
---|
248 | {{{ |
---|
249 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
250 | |
---|
251 | printf("hints = %s\n", Rp_ViewGetHints(v)); |
---|
252 | |
---|
253 | // The string: |
---|
254 | // hints = |
---|
255 | // is printed to the stdout. |
---|
256 | }}} |
---|
257 | |
---|
258 | void Rp_ViewSetHints(Rp_View *v, const char *val) |
---|
259 | Purpose: set the hints of the object |
---|
260 | Input Arguments: 2 |
---|
261 | 1. Rp_View *p - pointer to View object |
---|
262 | 2. const char *val - new hints |
---|
263 | Return Value: None |
---|
264 | Notes: a copy of the memory location val will be stored |
---|
265 | Code Example: |
---|
266 | {{{ |
---|
267 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
268 | |
---|
269 | printf("hints = %s\n", Rp_ViewGetHints(v)); |
---|
270 | Rp_ViewSetHints(v, "no hints"); |
---|
271 | printf("hints = %s\n", Rp_ViewGetHints(v)); |
---|
272 | |
---|
273 | // The strings: |
---|
274 | // hints = |
---|
275 | // hints = no hints |
---|
276 | // are printed to the stdout. |
---|
277 | }}} |
---|
278 | |
---|
279 | const void *Rp_ViewGetProperty (Rp_View *v, const char *key) const; |
---|
280 | Purpose: get a generic property from the property database |
---|
281 | Input Arguments: 2 |
---|
282 | 1. Rp_View *v - pointer to View object |
---|
283 | 2. const char *key - property name |
---|
284 | Return Value: value of the property |
---|
285 | Notes: None |
---|
286 | Code Example: |
---|
287 | {{{ |
---|
288 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
289 | |
---|
290 | printf("label = %s\n", Rp_ViewGetProperty(v,"label")); |
---|
291 | |
---|
292 | // The string: |
---|
293 | // label = |
---|
294 | // is printed to the stdout. |
---|
295 | }}} |
---|
296 | |
---|
297 | void Rp_ViewSetProperty (Rp_View *v, const char *key, const void *val, size_t nbytes); |
---|
298 | Purpose: set a generic property in the property database |
---|
299 | Input Arguments: 4 |
---|
300 | 1. Rp_View *v - pointer to View object |
---|
301 | 2. const char *key - property name |
---|
302 | 3. const void *val - property value |
---|
303 | 4. size_t nbytes - size (in bytes) of the value |
---|
304 | Return Value: None |
---|
305 | Notes: A copy of the memory pointed to by val is stored |
---|
306 | in the property database |
---|
307 | Code Example: |
---|
308 | {{{ |
---|
309 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
310 | |
---|
311 | printf("label = %s\n", Rp_ViewGetProperty(v,"label")); |
---|
312 | Rp_ViewSetProperty(v, "label", "Fermi-Dirac Factor", 19); |
---|
313 | printf("label = %s\n", Rp_ViewGetProperty(v, "label")); |
---|
314 | |
---|
315 | // The strings: |
---|
316 | // label = |
---|
317 | // label = Fermi-Dirac Factor |
---|
318 | // are printed to the stdout. |
---|
319 | }}} |
---|
320 | |
---|
321 | const char *Rp_ViewGetPropStr (Rp_View *v, const char *key) const; |
---|
322 | Purpose: get a string property from the property database |
---|
323 | Input Arguments: 2 |
---|
324 | 1. Rp_View *v - pointer to View object |
---|
325 | 2. const char *key - property name |
---|
326 | Return Value: value of the property |
---|
327 | Notes: None |
---|
328 | Code Example: |
---|
329 | {{{ |
---|
330 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
331 | |
---|
332 | printf("label = %s\n", Rp_ViewGetPropStr(v,"label")); |
---|
333 | |
---|
334 | // The string: |
---|
335 | // label = |
---|
336 | // is printed to the stdout. |
---|
337 | }}} |
---|
338 | |
---|
339 | void Rp_ViewSetPropStr (Rp_View *p, const char *key, const char *val); |
---|
340 | Purpose: set a string property in the property database |
---|
341 | Input Arguments: 3 |
---|
342 | 1. Rp_View *p - pointer to View object |
---|
343 | 2. const char *key - property name |
---|
344 | 3. const char *val - property value |
---|
345 | Return Value: None |
---|
346 | Notes: A copy of the memory pointed to by val is stored |
---|
347 | in the property database |
---|
348 | Code Example: |
---|
349 | {{{ |
---|
350 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
351 | |
---|
352 | printf("label = %s\n", Rp_ViewGetPropStr(v,"label")); |
---|
353 | Rp_ViewSetPropStr(v, "label", "Fermi-Dirac Factor"); |
---|
354 | printf("label = %s\n", Rp_ViewGetPropStr(v, "label")); |
---|
355 | |
---|
356 | // The strings: |
---|
357 | // label = |
---|
358 | // label = Fermi-Dirac Factor |
---|
359 | // are printed to the stdout. |
---|
360 | }}} |
---|
361 | |
---|
362 | void Rp_ViewPropRemove (Rp_View *v, const char *key); |
---|
363 | Purpose: remove a property from the property database |
---|
364 | Input Arguments: 1 |
---|
365 | 1. Rp_View *p - pointer to View object |
---|
366 | 2. const char *key - property name |
---|
367 | Return Value: value of the property |
---|
368 | Notes: None |
---|
369 | Code Example: |
---|
370 | {{{ |
---|
371 | Rp_View *v = Rp_ViewInit("fdfplots", 2, 1); |
---|
372 | |
---|
373 | Rp_ViewName(v, "fdfactor"); |
---|
374 | printf("name = %s\n", Rp_ViewGetPropStr(v, "name")); |
---|
375 | Rp_ViewPropRemove(v, "name"); |
---|
376 | printf("name = %s\n", Rp_ViewGetPropStr(v, "name")); |
---|
377 | |
---|
378 | // The strings: |
---|
379 | // name = fdfactor |
---|
380 | // name = |
---|
381 | // are printed to the stdout. |
---|
382 | }}} |
---|
383 | |
---|
384 | void Rp_ViewVValue(Rp_View *v, void *storage, size_t numHints, va_list arg) const; |
---|
385 | Purpose: return the value of the object after applying a |
---|
386 | varying number of hints about how the value |
---|
387 | should be configured |
---|
388 | Input Arguments: 4 |
---|
389 | 1. Rp_View *v - pointer to View object |
---|
390 | 2. void *storage - the return value |
---|
391 | 3. size_t numHints - number of hints provided |
---|
392 | 4. va_list arg - list of hints specified as a va_list |
---|
393 | Return Value: None |
---|
394 | Notes: vvalue will parse out the recognisable hints from |
---|
395 | va_list arg. Values stored in the object are |
---|
396 | not changed. |
---|
397 | Code Example: |
---|
398 | |
---|
399 | void Rp_ViewRandom(); |
---|
400 | Purpose: populate the object with a random value |
---|
401 | Input Arguments: 0 |
---|
402 | Return Value: None |
---|
403 | Notes: the current value of this object will be populated |
---|
404 | with a random value that fits within the min and |
---|
405 | max if they were specified. |
---|
406 | Code Example: |
---|
407 | |
---|
408 | Rp_Chain *Rp_ViewDiff(const Rp_Object *o); |
---|
409 | Purpose: return a linked list showing the differences between |
---|
410 | this object and Rp_Object *o |
---|
411 | Input Arguments: 1 |
---|
412 | 1. const Rp_Object *o - object to diff against |
---|
413 | Return Value: list of differences between objects |
---|
414 | Notes: None |
---|
415 | Code Example: |
---|
416 | |
---|
417 | void Rp_ViewConfigure(Rp_View *v, size_t as, ClientData c); |
---|
418 | Purpose: configure the object based on the data in "c". |
---|
419 | use "as" to determine the type of data in "c". |
---|
420 | Input Arguments: 3 |
---|
421 | 1. Rp_View *v - pointer to View object |
---|
422 | 2. size_t as - type of data stored in "c". |
---|
423 | valid values include: |
---|
424 | RPCONFIG_XML |
---|
425 | RPCONFIG_TREE |
---|
426 | 3. ClientData c - data to configure the object from. |
---|
427 | if as is... then c should be... |
---|
428 | RPCONFIG_XML const char *xmltext |
---|
429 | RPCONFIG_TREE RP_ParserXML *object |
---|
430 | Return Value: None |
---|
431 | Notes: object is configured based on values in "c" |
---|
432 | Code Example: |
---|
433 | |
---|
434 | void Rp_ViewDump(Rp_View *v, size_t as, ClientData c); |
---|
435 | Purpose: dump the object values based to the object "c". |
---|
436 | use "as" to determine how to dump the data. |
---|
437 | Input Arguments: 3 |
---|
438 | 1. Rp_View *v - pointer to View object |
---|
439 | 2. size_t as - type of data stored in "c". |
---|
440 | valid values include: |
---|
441 | RPCONFIG_XML |
---|
442 | RPCONFIG_TREE |
---|
443 | 3. ClientData c - data to configure the object from. |
---|
444 | if as is... then c should be... |
---|
445 | RPCONFIG_XML ClientDataXml *object |
---|
446 | RPCONFIG_TREE RP_ParserXML *object |
---|
447 | Return Value: None |
---|
448 | Notes: None |
---|
449 | Code Example: |
---|
450 | |
---|
451 | Outcome *Rp_ViewOutcome(Rp_View *p) const; |
---|
452 | Purpose: return the status of this object as an Outcome. |
---|
453 | Input Arguments: 1 |
---|
454 | 1. Rp_View *v - pointer to View object |
---|
455 | Return Value: status of the object as an Outcome |
---|
456 | Notes: None |
---|
457 | Code Example: |
---|
458 | |
---|
459 | const int Rp_ViewIs(Rp_View *v) const; |
---|
460 | Purpose: return an integer tag describing the object. |
---|
461 | Input Arguments: 1 |
---|
462 | 1. Rp_View *v - pointer to View object |
---|
463 | Return Value: integer tag unique to all plot objects |
---|
464 | Notes: None |
---|
465 | Code Example: |
---|
466 | |
---|
467 | void Rp_ViewPlot(Rp_View *v, const char *name, size_t row, size_t col, |
---|
468 | Rp_TableColumn *x, Rp_TableColumn *y, const char *s); |
---|
469 | Purpose: populate a view object with a plot |
---|
470 | Input Arguments: 8 required |
---|
471 | 1. v - pointer to View object |
---|
472 | 2. name - name of the plot within the view |
---|
473 | 3. row - row position of the plot within the view |
---|
474 | 4. col - column position of the plot within the view |
---|
475 | 5. x - table column to be used as X axis |
---|
476 | 6. y - table column to be used as Y axis |
---|
477 | 7. s - line style of the x/y data |
---|
478 | Return Value: None |
---|
479 | Notes: plots can be grouped together by specifying |
---|
480 | the same name, row, and column position for |
---|
481 | the plot over multiple calls to Rp_ViewPlot. |
---|
482 | Example: |
---|
483 | Rp_ViewPlot(v,"plot1",2,1,resultsTable,"X1","Y1","g:o"); |
---|
484 | Rp_ViewPlot(v,"plot1",2,1,resultsTable,"X1","Y2","b-o"); |
---|
485 | Code Example: |
---|
486 | {{{ |
---|
487 | Rp_Table *results = NULL; |
---|
488 | Rp_TableColumn *x1 = NULL; |
---|
489 | Rp_TableColumn *y1 = NULL; |
---|
490 | Rp_TableColumn *y2 = NULL; |
---|
491 | Rp_View *v1 = NULL; |
---|
492 | Rp_View *v2 = NULL; |
---|
493 | Rp_View *v3 = NULL; |
---|
494 | |
---|
495 | results = Rp_TableInit("dataTable") |
---|
496 | x1 = Rp_TableColumnInit(results, "Xvals", "X Values"); |
---|
497 | y1 = Rp_TableColumnInit(results, "Squared", "X Squared"); |
---|
498 | y2 = Rp_TableColumnInit(results, "Cubed", "X Cubed"); |
---|
499 | |
---|
500 | // view with two curves grouped on a single plot |
---|
501 | // 1) x vs x^2 |
---|
502 | // 2) x vs x^3 |
---|
503 | v1 = Rp_ViewInit("fdfview1"); |
---|
504 | Rp_ViewPlot(v1, "fdfPlot1", 1, 1, x1, y1, "g:o"); |
---|
505 | Rp_ViewPlot(v1, "fdfPlot1", 1, 1, x1, y2, "b-o"); |
---|
506 | |
---|
507 | // view with two plots, one stacked on top of the other |
---|
508 | // 1) x vs x^2 |
---|
509 | // 2) x vs x^3 |
---|
510 | v2 = Rp_ViewInit("fdfview2"); |
---|
511 | Rp_ViewPlot(v2, "fdfPlot2", 1, 1, x1, y1, "g:o"); |
---|
512 | Rp_ViewPlot(v2, "fdfPlot3", 2, 1, x1, y2, "b-o"); |
---|
513 | |
---|
514 | # create a view with two plots side by side |
---|
515 | # 1) x vs x^2 2) x vs x^3 |
---|
516 | v3 = Rp_ViewInit("fdfview3"); |
---|
517 | Rp_ViewPlot(v3, "fdfPlot4", 1, 1, x1, y1, "g:o"); |
---|
518 | Rp_ViewPlot(v3, "fdfPlot5", 1, 2, x1, y2, "b-o"); |
---|
519 | }}} |
---|
520 | |
---|
521 | void Rp_ViewSurf2D(Rp_View *v, const char *name, size_t row, size_t col, |
---|
522 | Rp_TableColumn *x, Rp_TableColumn *y, Rp_TableColumn *data); |
---|
523 | Purpose: populate a view object with a 2 dimensional surface |
---|
524 | Input Arguments: 8 required |
---|
525 | 1. v - pointer to View object |
---|
526 | 2. name - name of the 2d surface within the view |
---|
527 | 3. row - row position of the 2d surface within the view |
---|
528 | 4. col - column position of the 2d surface within the view |
---|
529 | 5. table - name of the table holding the data |
---|
530 | 6. x - column name from table to be used as X axis |
---|
531 | 7. y - column name from table to be used as Y axis |
---|
532 | 8. d - column name from table to be used as data |
---|
533 | Return Value: None |
---|
534 | Notes: 2D surfaces can be grouped together by specifying |
---|
535 | the same row and column position for the 2D Surface |
---|
536 | over multiple calls to Rp_ViewSurf2D |
---|
537 | Example: |
---|
538 | Rp_ViewSurf2D(v,"surf1",2,1,resultsTable,x1,y1,d1); |
---|
539 | Rp_ViewSurf2D(v,"surf2",2,1,resultsTable,x1,y1,d2); |
---|
540 | ToDo: |
---|
541 | 1. how to specify transfer function ranges |
---|
542 | Rp_Surface2DTransfer(...); |
---|
543 | 2. how to specify uni rect grid instead of explicit points |
---|
544 | - three values in the coords columns is assumed to be |
---|
545 | the min, max, and step for that direction of the |
---|
546 | uniform rectangular grid? Perhaps a function like: |
---|
547 | Rp_TableColumn *Rp_TableUniformColumnInit(size_t min, |
---|
548 | size_t max, size_t step); |
---|
549 | Code Example: |
---|
550 | {{{ |
---|
551 | Rp_Table *results = NULL; |
---|
552 | Rp_TableColumn *x1 = NULL; |
---|
553 | Rp_TableColumn *y1 = NULL; |
---|
554 | Rp_TableColumn *d1 = NULL; |
---|
555 | Rp_TableColumn *d2 = NULL; |
---|
556 | Rp_View *v1 = NULL; |
---|
557 | Rp_View *v2 = NULL; |
---|
558 | Rp_View *v3 = NULL; |
---|
559 | |
---|
560 | results = Rp_TableInit("dataTable") |
---|
561 | x1 = Rp_TableColumnInit(results, "Xpositions", "X Positions"); |
---|
562 | y1 = Rp_TableColumnInit(results, "Ypositions", "Y Positions"); |
---|
563 | d1 = Rp_TableColumnInit(results, "S1Data", "Surface 1 Data"); |
---|
564 | d2 = Rp_TableColumnInit(results, "S2Data", "Surface 2 Data"); |
---|
565 | |
---|
566 | // view with two 2D surfaces grouped in a single vizualization window |
---|
567 | v1 = Rp_ViewInit("fdfview1"); |
---|
568 | Rp_ViewSurf2D(v1, "fdfSurf1", 1, 1, x1, y1, d1); |
---|
569 | Rp_ViewSurf2D(v1, "fdfSurf2", 1, 1, x1, y1, d2); |
---|
570 | |
---|
571 | // view with two 2D surfaces, one stacked on top of the other |
---|
572 | v2 = Rp_ViewInit("fdfview2"); |
---|
573 | Rp_ViewSurf2D(v2, "fdfSurf3", 1, 1, x1, y1, d1); |
---|
574 | Rp_ViewSurf2D(v2, "fdfSurf4", 2, 1, x1, y2, d2); |
---|
575 | |
---|
576 | # create a view with two 2D surfaces side by side |
---|
577 | v3 = Rp_ViewInit("fdfview3"); |
---|
578 | Rp_ViewSurf2D(v3, "fdfSurf5", 1, 1, x1, y1, d1); |
---|
579 | Rp_ViewSurf2D(v3, "fdfSurf6", 1, 2, x1, y1, d2); |
---|
580 | }}} |
---|
581 | |
---|
582 | void Rp_ViewSurf3D(Rp_View *v, const char *name, size_t row, size_t col, |
---|
583 | Rp_TableColumn *x, Rp_TableColumn *y, Rp_TableColumn *z, Rp_TableColumn *data); |
---|
584 | Purpose: populate a view object with a 3 dimensional surface |
---|
585 | Input Arguments: 9 required |
---|
586 | 1. v - pointer to View object |
---|
587 | 2. name - name of the 3d surface within the view |
---|
588 | 3. row - row position of the 3d surface within the view |
---|
589 | 4. col - column position of the 3d surface within the view |
---|
590 | 5. table - name of the table holding the data |
---|
591 | 6. x - column name from table to be used as X axis |
---|
592 | 7. y - column name from table to be used as Y axis |
---|
593 | 8. z - column name from table to be used as Z axis |
---|
594 | 9. d - column name from table to be used as data |
---|
595 | Return Value: None |
---|
596 | Notes: 3D surfaces can be grouped together by specifying |
---|
597 | the same row, and column position for the 3D Surface |
---|
598 | over multiple calls to Rp_ViewSurf3D |
---|
599 | Example: |
---|
600 | Rp_ViewSurf3D(v,"surf1",2,1,resultsTable,x1,y1,z1,d1); |
---|
601 | Rp_ViewSurf3D(v,"surf2",2,1,resultsTable,x1,y1,z1,d2); |
---|
602 | ToDo: |
---|
603 | 1. how to specify transfer function ranges |
---|
604 | Rp_Surface2DTransfer(...); |
---|
605 | 2. how to specify uni rect grid instead of explicit points |
---|
606 | - three values in the coords columns is assumed to be |
---|
607 | the min, max, and step for that direction of the |
---|
608 | uniform rectangular grid? Perhaps a function like: |
---|
609 | Rp_TableColumn *Rp_TableUniformColumnInit(size_t min, |
---|
610 | size_t max, size_t step); |
---|
611 | Code Example: |
---|
612 | {{{ |
---|
613 | Rp_Table *results = NULL; |
---|
614 | Rp_TableColumn *x1 = NULL; |
---|
615 | Rp_TableColumn *y1 = NULL; |
---|
616 | Rp_TableColumn *z1 = NULL; |
---|
617 | Rp_TableColumn *d1 = NULL; |
---|
618 | Rp_TableColumn *d2 = NULL; |
---|
619 | Rp_View *v1 = NULL; |
---|
620 | Rp_View *v2 = NULL; |
---|
621 | Rp_View *v3 = NULL; |
---|
622 | |
---|
623 | results = Rp_TableInit("dataTable") |
---|
624 | x1 = Rp_TableColumnInit(results, "Xpositions", "X Positions"); |
---|
625 | y1 = Rp_TableColumnInit(results, "Ypositions", "Y Positions"); |
---|
626 | z1 = Rp_TableColumnInit(results, "Zpositions", "Z Positions"); |
---|
627 | d1 = Rp_TableColumnInit(results, "S1Data", "Surface 1 Data"); |
---|
628 | d2 = Rp_TableColumnInit(results, "S2Data", "Surface 2 Data"); |
---|
629 | |
---|
630 | // view with two 3D surfaces grouped in a single vizualization window |
---|
631 | v1 = Rp_ViewInit("fdfview1"); |
---|
632 | Rp_ViewSurf3D(v1, "fdfSurf1", 1, 1, x1, y1, z1, d1); |
---|
633 | Rp_ViewSurf3D(v1, "fdfSurf1", 1, 1, x1, y1, z1, d2); |
---|
634 | |
---|
635 | // view with two 3D surfaces, one stacked on top of the other |
---|
636 | v2 = Rp_ViewInit("fdfview2"); |
---|
637 | Rp_ViewSurf3D(v2, "fdfSurf2", 1, 1, x1, y1, z1, d1); |
---|
638 | Rp_ViewSurf3D(v2, "fdfSurf3", 2, 1, x1, y2, z1, d2); |
---|
639 | |
---|
640 | # create a view with two 3D surfaces side by side |
---|
641 | v3 = Rp_ViewInit("fdfview3"); |
---|
642 | Rp_ViewSurf3D(v3, "fdfSurf4", 1, 1, x1, y1, z1, d1); |
---|
643 | Rp_ViewSurf3D(v3, "fdfSurf5", 1, 2, x1, y1, z1, d2); |
---|
644 | }}} |
---|
645 | |
---|
646 | void Rp_ViewImage(Rp_View *v, Rp_Image *img, size_t row, size_t col); |
---|
647 | |
---|
648 | void Rp_ViewNote(Rp_View *v, Rp_Note *note, size_t row, size_t col); |
---|