1 | /* |
---|
2 | |
---|
3 | Name: mc.h |
---|
4 | |
---|
5 | Coded: Paul Ning |
---|
6 | |
---|
7 | Modified by: Brian Curless |
---|
8 | Computer Graphics Laboratory |
---|
9 | Stanford University |
---|
10 | |
---|
11 | Comment: Include file for global definitions and typing |
---|
12 | |
---|
13 | Copyright (1997) The Board of Trustees of the Leland Stanford Junior |
---|
14 | University. Except for commercial resale, lease, license or other |
---|
15 | commercial transactions, permission is hereby given to use, copy, |
---|
16 | modify this software for academic purposes only. No part of this |
---|
17 | software or any derivatives thereof may be used in the production of |
---|
18 | computer models for resale or for use in a commercial |
---|
19 | product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND |
---|
20 | CONCERNING THIS SOFTWARE. No support is implied or provided. |
---|
21 | |
---|
22 | */ |
---|
23 | |
---|
24 | |
---|
25 | #ifndef _MC_H_ |
---|
26 | #define _MC_H_ |
---|
27 | |
---|
28 | #include "mcfile.h" |
---|
29 | #include "OccGridRLE.h" |
---|
30 | #include "limits.h" |
---|
31 | |
---|
32 | #ifdef __cplusplus |
---|
33 | extern "C" { |
---|
34 | #endif |
---|
35 | |
---|
36 | /* |
---|
37 | * Global definitions |
---|
38 | */ |
---|
39 | |
---|
40 | typedef struct { |
---|
41 | float density; |
---|
42 | float nx; |
---|
43 | float ny; |
---|
44 | float nz; |
---|
45 | float confidence; |
---|
46 | unsigned char valid; |
---|
47 | unsigned char realData; |
---|
48 | } Point; |
---|
49 | |
---|
50 | typedef Point **Section; |
---|
51 | |
---|
52 | typedef Point Cube[8]; |
---|
53 | |
---|
54 | typedef int Index; |
---|
55 | |
---|
56 | typedef struct {Index A; |
---|
57 | Index B; |
---|
58 | Index C; |
---|
59 | } Triple; |
---|
60 | |
---|
61 | typedef struct {Boolean edge[12]; |
---|
62 | int Ntriangles; |
---|
63 | Triple *TriangleList; |
---|
64 | } EdgeTableEntry; |
---|
65 | |
---|
66 | #define Nrow Nz |
---|
67 | #define Ncol Ny |
---|
68 | #define Nslice Nx |
---|
69 | |
---|
70 | #define drow dz |
---|
71 | #define dcol dy |
---|
72 | #define dslice dx |
---|
73 | |
---|
74 | #define round(x) ((int) ((x) > 0 ? (x)+0.5 : (x)-0.5)) |
---|
75 | |
---|
76 | |
---|
77 | /* |
---|
78 | * Global variable typing |
---|
79 | */ |
---|
80 | |
---|
81 | extern char infile[PATH_MAX], outfile[PATH_MAX]; |
---|
82 | extern int WriteNormals; |
---|
83 | extern int UseValueWeightProduct; |
---|
84 | extern int SaveGradientAsConfidence; |
---|
85 | extern FILE *InSlice,*OutMCFile; |
---|
86 | extern int FirstSliceFileNumber; |
---|
87 | |
---|
88 | extern int Nx,Ny,Nz; |
---|
89 | extern float dx,dy,dz; |
---|
90 | |
---|
91 | extern float FtoSScale; |
---|
92 | extern float NrmMagScale; |
---|
93 | |
---|
94 | extern int i0,j_0,k0; |
---|
95 | extern int i1,j_1,k1; |
---|
96 | extern float threshold; |
---|
97 | extern float xstart,ystart,zstart; |
---|
98 | extern int TotalTriangles; |
---|
99 | extern OccGridRLE *occGrid; |
---|
100 | extern int OCC_CONF_THRESHOLD; |
---|
101 | |
---|
102 | extern EdgeTableEntry TheEdgeTable[256]; |
---|
103 | |
---|
104 | /* |
---|
105 | * Global function types |
---|
106 | */ |
---|
107 | |
---|
108 | extern void GetInfo(),Init(),DoSlices(), DoSlicesOccRLE(); |
---|
109 | extern void InitEdgeTable(); |
---|
110 | extern void DoCube(Cube cube, int i, int j, int k); |
---|
111 | extern TriangleVertex *NewDoCube(Cube cube, int i, int j, int k, |
---|
112 | unsigned char *pEdgeTableIndex); |
---|
113 | extern void Quit(); |
---|
114 | extern void Fatal(char *message); |
---|
115 | |
---|
116 | #ifndef CHUNK_SIZE |
---|
117 | #define CHUNK_SIZE 100000 |
---|
118 | #endif |
---|
119 | |
---|
120 | #ifdef __cplusplus |
---|
121 | } |
---|
122 | #endif |
---|
123 | |
---|
124 | #endif |
---|