GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
viz.h
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <math.h>
3
#include <sys/types.h>
4
5
#define GRID_ID "grid003.02"
6
#define DSPF_ID "dspf003.02"
7
8
#define LINTERP(A,B,C) ((C-A)/(B-A))*255
9
#define VOID_TYPE char
10
11
#define FLINTERP(A,B,C,D,E) (((C-A)*(E-D))/(B-A)) + D
12
/*#define LENGTH(A,B,C) sqrt(A*A + B*B + C*C) */
13
14
/* used in the lambert shading model */
15
#define NV(A,B,C) ((A*A) + (B*B) + (C*C))
16
#define MAXLITS 3
17
18
#define MAXTHRESH 127
19
#define MAXPOLY 10
20
21
typedef
struct
22
{
23
int
nthres
;
/* number of thresholds */
24
float
tvalue[
MAXTHRESH
];
/* array of threshold values */
25
int
litmodel
;
/* 1 = flat, 2 = gradient(6), 3 = gradient(26) */
26
}
cmndln_info
;
27
28
typedef
struct
29
{
30
int
token
;
/*type of file */
31
void
*g3mapin, *
g3mapout
;
/* G3D_Map */
32
FILE *datainfp, *
dataoutfp
;
33
FILE *dspfinfp, *
dspfoutfp
;
34
int
xdim, ydim,
zdim
;
35
float
north, south, east,
west
;
36
float
top
, bottom;
37
float
ns_res, ew_res,
tb_res
;
38
int
zone
;
39
int
proj
;
40
int
type
;
/*1 = short int, 2 = integer, 3 = float */
41
float
min
,
max
;
/* max and min values present in the data */
42
long
Dataoff
;
/* offset of beginning of data in file */
43
long
Lookoff
;
/* offset of beginning of lookup table in file */
44
cmndln_info
linefax
;
/* more global info */
45
int
headsize
;
/* size of datainf file header, necessary for random
46
access to grid3 data */
47
}
file_info
;
48
49
50
typedef
struct
51
{
52
float
v1[3];
/*polygon vertices */
53
float
v2[3];
54
float
v3[3];
55
float
n1[3], n2[3], n3[3];
/*normals for vertices */
56
}
poly_info
;
57
58
typedef
struct
59
{
60
int
npoly
;
/* number of polygons in cube at given threshold */
61
int
t_ndx
;
/* index of given threshold */
62
poly_info
poly[
MAXPOLY
];
/*vertices and normals */
63
}
cube_info
;
64
65
typedef
struct
66
{
67
int
n_thresh
;
68
cube_info
data
[
MAXTHRESH
];
69
}
Cube_data
;
70
71
typedef
struct
72
{
73
int
nverts
;
74
int
verts[8];
75
int
nedges
;
76
int
edges[12];
77
int
npolys
;
78
int
polys[30];
79
}
CELL_ENTRY
;
/* for writing out in condensed format */
80
81
/* cube_io.c */
82
int
write_cube
(
Cube_data
*,
int
,
file_info
*);
83
int
write_cube_buffer
(
unsigned
char
*,
int
,
int
,
file_info
*);
84
int
read_cube
(
Cube_data
*,
file_info
*);
85
int
my_fread
(
char
*,
int
,
int
, FILE *);
86
int
my_fread
(
char
*,
int
,
int
, FILE *);
87
int
reset_reads
(
file_info
*);
88
int
new_dspf
(
file_info
*);
89
90
/* dspf_header.c */
91
int
dfwrite_header
(
file_info
*);
92
int
dfread_header
(
file_info
*);
93
int
dfread_header_old
(
file_info
*, FILE *);
94
95
/* print_info.c */
96
int
print_head_info
(
file_info
*);
97
98
/* struct_copy.c */
99
int
struct_copy
(
char
*,
char
*,
int
);
100
101
#ifdef MAIN
102
#define GLOBAL
103
#else
104
#define GLOBAL extern
105
#endif
106
107
#include "
cell_table.h
"
lib
dspf
viz.h
Generated on Thu Sep 26 2013 09:48:07 for GRASS Programmer's Manual by
1.8.4