GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73577
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
nviz.h
Go to the documentation of this file.
1 #ifndef GRASS_NVIZ_H
2 #define GRASS_NVIZ_H
3 
4 #include <grass/config.h>
5 
6 /*** Windows headers ***/
7 #if defined(OPENGL_WINDOWS)
8 # define WIN32_LEAN_AND_MEAN
9 # include <windows.h>
10 # undef WIN32_LEAN_AND_MEAN
11 # include <winnt.h>
12 # include <GL/gl.h>
13 # include <GL/glext.h>
14 
15 /*** X Window System headers ***/
16 #elif defined(OPENGL_X11)
17 # include <X11/Xlib.h>
18 # include <X11/Xutil.h>
19 # include <X11/Xatom.h> /* for XA_RGB_DEFAULT_MAP atom */
20 # define GL_GLEXT_PROTOTYPES
21 # include <GL/glx.h>
22 
23 /*** Mac headers ***/
24 #elif defined(OPENGL_AQUA)
25 # if defined(OPENGL_AGL)
26 # define Cursor QDCursor
27 # include <AGL/agl.h>
28 # undef Cursor
29 # else
30 # include <OpenGL/CGLTypes.h>
31 # include <OpenGL/CGLCurrent.h>
32 # include <OpenGL/OpenGL.h>
33 # endif
34 # include <ApplicationServices/ApplicationServices.h>
35 
36 #else /* make sure only one platform defined */
37 # error Unsupported platform, or confused platform defines...
38 #endif
39 
40 #include <grass/ogsf.h>
41 
42 #define MAP_OBJ_UNDEFINED 0
43 #define MAP_OBJ_SURF 1
44 #define MAP_OBJ_VOL 2
45 #define MAP_OBJ_VECT 3
46 #define MAP_OBJ_SITE 4
47 
48 #define DRAW_COARSE 0
49 #define DRAW_FINE 1
50 #define DRAW_BOTH 2
51 
52 /* quick draw mode */
53 #define DRAW_QUICK_SURFACE 0x01
54 #define DRAW_QUICK_VLINES 0x02
55 #define DRAW_QUICK_VPOINTS 0x04
56 #define DRAW_QUICK_VOLUME 0x08
57 
58 #define RANGE (5 * GS_UNIT_SIZE)
59 #define RANGE_OFFSET (2 * GS_UNIT_SIZE)
60 #define ZRANGE (3 * GS_UNIT_SIZE)
61 #define ZRANGE_OFFSET (1 * GS_UNIT_SIZE)
62 
63 #define DEFAULT_SURF_COLOR 0x33BBFF
64 
65 #define FORMAT_PPM 1
66 #define FORMAT_TIF 2
67 
68 /* data structures */
69 typedef struct
70 {
71  int id;
72  float brt;
73  float r, g, b;
74  float ar, ag, ab; /* ambient rgb */
75  float x, y, z, w; /* position */
76 } light_data;
77 
79 {
80  int id;
81  unsigned long color;
82  float elev;
83  int where[4];
84 };
85 
86 struct arrow_data
87 {
88  unsigned long color;
89  float size;
90  float where[3];
91 };
92 
94 {
95  int id;
96  unsigned long color;
97  float size;
98  float where[3];
99 };
100 
101 typedef struct
102 {
103  /* ranges */
104  float zrange, xyrange;
105 
106  /* cplanes */
108  int cur_cplane, cp_on[MAX_CPLANES];
109  float cp_trans[MAX_CPLANES][3];
110  float cp_rot[MAX_CPLANES][3];
111 
112  /* light */
114 
115  /* fringe */
117  struct fringe_data **fringe;
118 
119  /* north arrow */
121  struct arrow_data *arrow;
122 
123  /* scalebar */
126 
127  /* background color */
128  int bgcolor;
129 
130 } nv_data;
131 
133 {
134 #if defined(OPENGL_X11)
135  Display *displayId; /* display connection */
136  GLXContext contextId; /* GLX rendering context */
137  Pixmap pixmap;
138  GLXPixmap windowId;
139 #elif defined(OPENGL_AQUA)
140 #if defined(OPENGL_AGL)
141  AGLPixelFormat pixelFmtId;
142  AGLContext contextId;
143  AGLPbuffer windowId;
144 #else
145  CGLContextObj contextId;
146 #endif
147 #elif defined(OPENGL_WINDOWS)
148  HDC displayId; /* display context */
149  HGLRC contextId; /* rendering context */
150 #endif
151  int width, height;
152 };
153 
154 #include <grass/defs/nviz.h>
155 
156 #endif /* GRASS_NVIZ_H */
int cur_cplane
Definition: nviz.h:108
float size
Definition: nviz.h:97
float r
Definition: nviz.h:73
#define MAX_CPLANES
Definition: ogsf.h:45
struct fringe_data ** fringe
Definition: nviz.h:117
int id
Definition: nviz.h:71
#define MAX_LIGHTS
Definition: ogsf.h:44
float z
Definition: nviz.h:75
float ar
Definition: nviz.h:74
int id
Definition: nviz.h:80
float size
Definition: nviz.h:89
unsigned long color
Definition: nviz.h:96
int draw_arrow
Definition: nviz.h:120
#define x
int num_cplanes
Definition: nviz.h:107
float zrange
Definition: nviz.h:104
double b
Definition: r_raster.c:39
float elev
Definition: nviz.h:82
unsigned long color
Definition: nviz.h:81
float g
Definition: named_colr.c:8
float brt
Definition: nviz.h:72
struct arrow_data * arrow
Definition: nviz.h:121
int num_scalebars
Definition: nviz.h:124
float where[3]
Definition: nviz.h:98
int num_fringes
Definition: nviz.h:116
Definition: nviz.h:101
int where[4]
Definition: nviz.h:83
int id
Definition: nviz.h:95
struct scalebar_data ** scalebar
Definition: nviz.h:125
int height
Definition: nviz.h:151
float where[3]
Definition: nviz.h:90
int bgcolor
Definition: nviz.h:128
int width
Definition: nviz.h:151
unsigned long color
Definition: nviz.h:88