-
Notifications
You must be signed in to change notification settings - Fork 5
/
render_tin.h
103 lines (86 loc) · 2 KB
/
render_tin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* ************************************************************
*
* MODULE: r.refine
*
* Authors: Jon Todd <jonrtodd@gmail.com>, Laura Toma <ltoma@bowdoin.edu>
* Bowdoin College, USA
*
* Purpose: convert grid data to TIN
*
* COPYRIGHT:
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
* for details.
*
*
************************************************************ */
/******************************************************************************
*
* render_tin.h render a TIN structure to an Open GL window
*
* AUTHOR(S): Jonathan Todd - <jonrtodd@gmail.com>
*
* UPDATED: jt 2005-08-15
*
* COMMENTS: We need to use a lot of global with Open GL since there
* is no way to pass variables into the display function
*
*****************************************************************************/
#ifndef __render_tin_h
#define __render_tin_h
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include "refine_tin.h"
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
//
// Initialize the camera view
//
void OGL_init_view();
//
// Initialize the Open GL window
//
void OGL_init(int *argc, char** argv);
//
// run display loop
//
void OGL_render(int argc, char** argv);
//
// map elevations to values to specified level h, this allows the user
// to control elevation display so that the terrain could appear 2D or
// 3D
//
float z_map(int h);
//
// Traverse a tin_tile rendering each triangle
//
void drawTinTile(TIN_TILE *tt);
//
// set the color based on a given height
//
void colorMap(int h);
//
// Loop through the tiles in a tin and output each one
//
void drawTin(TIN_TILE *tt);
//
// handle idle window
//
void idle(void);
//
// display - controls what is drawn to the screen
//
void display(void);
//
// handle keypress events
//
void keypress(unsigned char key, int x, int y);
//
// creates a menu
//
void mainMenu(int value);
#endif //__render_tin_h