source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/march/mcfile.h @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.4 KB
Line 
1/*
2
3Name:         mcfile.h
4
5Coded:        Paul Ning
6
7Modified by:  Brian Curless
8              Computer Graphics Laboratory
9              Stanford University
10
11Comment:      Include file for Marching Cubes File Package
12
13
14Copyright (1997) The Board of Trustees of the Leland Stanford Junior
15University. Except for commercial resale, lease, license or other
16commercial transactions, permission is hereby given to use, copy,
17modify this software for academic purposes only.  No part of this
18software or any derivatives thereof may be used in the production of
19computer models for resale or for use in a commercial
20product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
21CONCERNING THIS SOFTWARE.  No support is implied or provided.
22
23*/
24
25
26/*
27 * Marching Cubes File Format
28 *
29 * ----------------------
30 * |       header       |
31 * ----------------------
32 * |    surface data    |
33 * ----------------------
34 */
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40
41/*
42 * GENERAL
43 */
44
45typedef long Boolean;
46
47#ifndef TRUE
48#define TRUE 1
49#endif
50
51#ifndef FALSE
52#define FALSE 0
53#endif
54
55/*
56 * HEADER STUFF
57 */
58
59typedef struct {
60  int mc_magic;            /* magic number */
61  int mc_type;             /* type of mc file */
62  int mc_tmaptype;         /* type of texture map */
63  int mc_length;           /* length (in bytes) of surface data */
64} mcfile;
65
66#define MC_MAGIC         0xFEDECABA
67
68/* mc_types */
69#define MCT_STANDARD  0    /* list of triangles */
70#define MCT_TREE      1    /* pruned tree file */
71
72/* mc_tmaptypes */
73#define MCTM_NONE     0    /* no texture map */
74#define MCTM_STANDARD 1    /* one value (0-255) per vertex */
75#define MCTM_DOUBLE   2    /* two values per vertex */
76
77/* functions */
78extern Boolean IsMCFile(FILE *fp);
79extern void MC_InitHeader(FILE *fp);
80extern void MC_WriteHeader(FILE *fp, mcfile header);
81extern mcfile MC_ReadHeader(FILE *fp);
82
83
84/*
85 * SURFACE DATA STUFF
86 */
87
88typedef struct {
89  float x, y, z;        /* position components */
90  float nx, ny, nz;     /* normal components */
91  float confidence;
92  unsigned char tex1;   /* first texture value */
93  unsigned char tex2;   /* second texture value */
94  signed char ncx, ncy, ncz;   /* used to ensure faces are
95                                  oriented consistently */
96  unsigned char realData;
97  unsigned char valid;
98} TriangleVertex;
99
100/* functions */
101extern void MC_WriteTriangleVertex(FILE *fp,TriangleVertex vertex);
102extern TriangleVertex MC_ReadTriangleVertex(FILE *fp);
103
104
105#ifdef __cplusplus
106}
107#endif
108
Note: See TracBrowser for help on using the repository browser.