C Structure Definitions
// TIN file header
typedef struct { |
char RecogStr[4] ; // Recognition "TTIN" |
UINT RecogVal ; // Recognition 20101221 |
UINT Version ; // Version 1 |
UINT HdrSize ; // Header size = sizeof(SurfHdr) |
UINT PntCnt ; // Number of points |
UINT PntSize ; // Size of each point 12 |
UINT TriCnt ; // Number of triangles |
UINT TriSize ; // Size of each triangle 28 |
char Desc[40] ; // Descriptive name for surface |
char Software[40] ; // Software which generated the file |
UINT Type ; // Surface type (0=ground,1=design,2=bedrock,..) |
UINT CoordSize ; // Number of integer steps per real world unit |
double OrgX ; // Origin of coordinate system |
double OrgY ; |
double OrgZ ; |
UINT64 PntPos ; // File position where point data starts |
UINT64 TriPos ; // File position where triangle data starts |
} TinHdr ;
// TIN file point record
typedef struct { |
long X ; |
long Y ; |
long Z ; |
BYTE Break ; // Break line edge with previous point |
BYTE Type ; // Point type TINPT_xxxx |
} TinPnt ;
// TIN file triangle record
typedef struct { |
UINT Vertex[3] ; // Triangle vertices in clockwise order |
UINT Neigbour[3]; // Neighbour triangle indexes |
BYTE Flags ; // Bits 0-1:excluded,2-3:edge0,4-5:edge1,6-7:edge2 |
BYTE Domain ; // Region or land type |
} TinTri ;
// Point types
#define TINPT_RANDOM 0
#define TINPT_SOFTBRK 1
#define TINPT_HARDBRK 2
#define TINPT_CONTOUR 3
#define TINPT_INFERRED 4
#define TINPT_OUTBND 5
#define TINPT_INTBND 6