1 |
|
|
/* |
2 |
|
|
Teem: Tools to process and visualize scientific data and images . |
3 |
|
|
Copyright (C) 2013, 2012, 2011, 2010, 2009 University of Chicago |
4 |
|
|
Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann |
5 |
|
|
Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah |
6 |
|
|
|
7 |
|
|
This library is free software; you can redistribute it and/or |
8 |
|
|
modify it under the terms of the GNU Lesser General Public License |
9 |
|
|
(LGPL) as published by the Free Software Foundation; either |
10 |
|
|
version 2.1 of the License, or (at your option) any later version. |
11 |
|
|
The terms of redistributing and/or modifying this software also |
12 |
|
|
include exceptions to the LGPL that facilitate static linking. |
13 |
|
|
|
14 |
|
|
This library is distributed in the hope that it will be useful, |
15 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 |
|
|
Lesser General Public License for more details. |
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU Lesser General Public License |
20 |
|
|
along with this library; if not, write to Free Software Foundation, Inc., |
21 |
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
22 |
|
|
*/ |
23 |
|
|
|
24 |
|
|
#include "gage.h" |
25 |
|
|
#include "privateGage.h" |
26 |
|
|
|
27 |
|
|
void |
28 |
|
|
_gageSclIv3Print (FILE *file, gageContext *ctx, gagePerVolume *pvl) { |
29 |
|
|
double *iv3; |
30 |
|
|
int i, fd; |
31 |
|
|
|
32 |
|
|
iv3 = pvl->iv3; |
33 |
|
|
fd = 2*ctx->radius; |
34 |
|
|
fprintf(file, "iv3[]:\n"); |
35 |
|
|
switch(fd) { |
36 |
|
|
case 2: |
37 |
|
|
fprintf(file, "% 10.4f % 10.4f\n", (float)iv3[6], (float)iv3[7]); |
38 |
|
|
fprintf(file, " % 10.4f % 10.4f\n\n", (float)iv3[4], (float)iv3[5]); |
39 |
|
|
fprintf(file, "% 10.4f % 10.4f\n", (float)iv3[2], (float)iv3[3]); |
40 |
|
|
fprintf(file, " % 10.4f % 10.4f\n", (float)iv3[0], (float)iv3[1]); |
41 |
|
|
break; |
42 |
|
|
case 4: |
43 |
|
|
for (i=3; i>=0; i--) { |
44 |
|
|
fprintf(file, "% 10.4f % 10.4f % 10.4f % 10.4f\n", |
45 |
|
|
(float)iv3[12+16*i], (float)iv3[13+16*i], |
46 |
|
|
(float)iv3[14+16*i], (float)iv3[15+16*i]); |
47 |
|
|
fprintf(file, " % 10.4f %c% 10.4f % 10.4f%c % 10.4f\n", |
48 |
|
|
(float)iv3[ 8+16*i], (i==1||i==2)?'\\':' ', |
49 |
|
|
(float)iv3[ 9+16*i], (float)iv3[10+16*i], (i==1||i==2)?'\\':' ', |
50 |
|
|
(float)iv3[11+16*i]); |
51 |
|
|
fprintf(file, " % 10.4f %c% 10.4f % 10.4f%c % 10.4f\n", |
52 |
|
|
(float)iv3[ 4+16*i], (i==1||i==2)?'\\':' ', |
53 |
|
|
(float)iv3[ 5+16*i], (float)iv3[ 6+16*i], (i==1||i==2)?'\\':' ', |
54 |
|
|
(float)iv3[ 7+16*i]); |
55 |
|
|
fprintf(file, " % 10.4f % 10.4f % 10.4f % 10.4f\n", |
56 |
|
|
(float)iv3[ 0+16*i], (float)iv3[ 1+16*i], |
57 |
|
|
(float)iv3[ 2+16*i], (float)iv3[ 3+16*i]); |
58 |
|
|
if (i) fprintf(file, "\n"); |
59 |
|
|
} |
60 |
|
|
break; |
61 |
|
|
default: |
62 |
|
|
for (i=0; i<fd*fd*fd; i++) { |
63 |
|
|
fprintf(file, " iv3[% 3d,% 3d,% 3d] = % 10.4f\n", |
64 |
|
|
i%fd, (i/fd)%fd, i/(fd*fd), (float)iv3[i]); |
65 |
|
|
} |
66 |
|
|
break; |
67 |
|
|
} |
68 |
|
|
return; |
69 |
|
|
} |