Last change
on this file since 1064 was
1064,
checked in by dkearney, 16 years ago
|
adding some example of using the buffer and dx writer objects.
|
File size:
672 bytes
|
Line | |
---|
1 | #include <iostream> |
---|
2 | #include <cstdio> |
---|
3 | #include "RpDXWriter.h" |
---|
4 | |
---|
5 | int main() |
---|
6 | { |
---|
7 | Rappture::DXWriter d; |
---|
8 | float i = 0.0; |
---|
9 | // int rank = 3; |
---|
10 | size_t p[] = {3,5,5}; |
---|
11 | // float origin[] = {0.0,0.0,0.0}; |
---|
12 | // float delta[] = {1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0}; |
---|
13 | |
---|
14 | // d.rank(rank); |
---|
15 | // d.origin(origin); |
---|
16 | // d.delta(delta); |
---|
17 | d.counts(p); |
---|
18 | |
---|
19 | for(size_t z = 0; z < p[2]; z++) { |
---|
20 | for(size_t y = 0; y < p[1]; y++) { |
---|
21 | for(size_t x = 0; x < p[0]; x++) { |
---|
22 | i = x*y*z; |
---|
23 | d.data(&i); |
---|
24 | } |
---|
25 | } |
---|
26 | } |
---|
27 | |
---|
28 | FILE *fp = NULL; |
---|
29 | fp = fopen("myDXFile.dx","w"); |
---|
30 | d.write(fp); |
---|
31 | fclose(fp); |
---|
32 | |
---|
33 | return 0; |
---|
34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.