GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
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
78
struct
fringe_data
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
93
struct
scalebar_data
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 */
107
int
num_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 */
113
light_data
light[
MAX_LIGHTS
];
114
115
/* fringe */
116
int
num_fringes
;
117
struct
fringe_data
**
fringe
;
118
119
/* north arrow */
120
int
draw_arrow
;
121
struct
arrow_data
*
arrow
;
122
123
/* scalebar */
124
int
num_scalebars
;
125
struct
scalebar_data
**
scalebar
;
126
127
/* background color */
128
int
bgcolor
;
129
130
}
nv_data
;
131
132
struct
render_window
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 */
arrow_data
Definition:
nviz.h:86
render_window::displayId
Display * displayId
Definition:
nviz.h:135
nv_data::cur_cplane
int cur_cplane
Definition:
nviz.h:108
scalebar_data::size
float size
Definition:
nviz.h:97
light_data::r
float r
Definition:
nviz.h:73
MAX_CPLANES
#define MAX_CPLANES
Definition:
ogsf.h:45
nv_data::fringe
struct fringe_data ** fringe
Definition:
nviz.h:117
light_data::id
int id
Definition:
nviz.h:71
MAX_LIGHTS
#define MAX_LIGHTS
Definition:
ogsf.h:44
light_data::z
float z
Definition:
nviz.h:75
render_window::contextId
GLXContext contextId
Definition:
nviz.h:136
light_data::ar
float ar
Definition:
nviz.h:74
nviz.h
config.h
fringe_data::id
int id
Definition:
nviz.h:80
arrow_data::size
float size
Definition:
nviz.h:89
scalebar_data::color
unsigned long color
Definition:
nviz.h:96
nv_data::draw_arrow
int draw_arrow
Definition:
nviz.h:120
x
#define x
render_window::windowId
GLXPixmap windowId
Definition:
nviz.h:138
fringe_data
Definition:
nviz.h:78
nv_data::num_cplanes
int num_cplanes
Definition:
nviz.h:107
nv_data::zrange
float zrange
Definition:
nviz.h:104
b
double b
Definition:
r_raster.c:39
fringe_data::elev
float elev
Definition:
nviz.h:82
fringe_data::color
unsigned long color
Definition:
nviz.h:81
g
float g
Definition:
named_colr.c:8
scalebar_data
Definition:
nviz.h:93
light_data::brt
float brt
Definition:
nviz.h:72
nv_data::arrow
struct arrow_data * arrow
Definition:
nviz.h:121
ogsf.h
nv_data::num_scalebars
int num_scalebars
Definition:
nviz.h:124
light_data
Definition:
nviz.h:69
nv_data::num_fringes
int num_fringes
Definition:
nviz.h:116
nv_data
Definition:
nviz.h:101
fringe_data::where
int where[4]
Definition:
nviz.h:83
scalebar_data::id
int id
Definition:
nviz.h:95
render_window::pixmap
Pixmap pixmap
Definition:
nviz.h:137
nv_data::scalebar
struct scalebar_data ** scalebar
Definition:
nviz.h:125
render_window
Definition:
nviz.h:132
nv_data::bgcolor
int bgcolor
Definition:
nviz.h:128
render_window::width
int width
Definition:
nviz.h:151
arrow_data::color
unsigned long color
Definition:
nviz.h:88
include
grass
nviz.h
Generated on Tue Feb 14 2023 05:56:01 for GRASS GIS 8 Programmer's Manual by
1.8.13