GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
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
35
#else
/* make sure only one platform defined */
36
#error Unsupported platform, or confused platform defines...
37
#endif
38
39
#include <
grass/ogsf.h
>
40
41
#define MAP_OBJ_UNDEFINED 0
42
#define MAP_OBJ_SURF 1
43
#define MAP_OBJ_VOL 2
44
#define MAP_OBJ_VECT 3
45
#define MAP_OBJ_SITE 4
46
47
#define DRAW_COARSE 0
48
#define DRAW_FINE 1
49
#define DRAW_BOTH 2
50
51
/* quick draw mode */
52
#define DRAW_QUICK_SURFACE 0x01
53
#define DRAW_QUICK_VLINES 0x02
54
#define DRAW_QUICK_VPOINTS 0x04
55
#define DRAW_QUICK_VOLUME 0x08
56
57
#define RANGE (5 * GS_UNIT_SIZE)
58
#define RANGE_OFFSET (2 * GS_UNIT_SIZE)
59
#define ZRANGE (3 * GS_UNIT_SIZE)
60
#define ZRANGE_OFFSET (1 * GS_UNIT_SIZE)
61
62
#define DEFAULT_SURF_COLOR 0x33BBFF
63
64
#define FORMAT_PPM 1
65
#define FORMAT_TIF 2
66
67
/* data structures */
68
typedef
struct
{
69
int
id
;
70
float
brt
;
71
float
r
,
g
,
b
;
72
float
ar, ag,
ab
;
/* ambient rgb */
73
float
x
, y, z,
w
;
/* position */
74
}
light_data
;
75
76
struct
fringe_data
{
77
int
id
;
78
unsigned
long
color
;
79
float
elev
;
80
int
where
[4];
81
};
82
83
struct
arrow_data
{
84
unsigned
long
color
;
85
float
size
;
86
float
where
[3];
87
};
88
89
struct
scalebar_data
{
90
int
id
;
91
unsigned
long
color
;
92
float
size
;
93
float
where
[3];
94
};
95
96
typedef
struct
{
97
/* ranges */
98
float
zrange,
xyrange
;
99
100
/* cplanes */
101
int
num_cplanes
;
102
int
cur_cplane, cp_on[
MAX_CPLANES
];
103
float
cp_trans[
MAX_CPLANES
][3];
104
float
cp_rot[
MAX_CPLANES
][3];
105
106
/* light */
107
light_data
light[
MAX_LIGHTS
];
108
109
/* fringe */
110
int
num_fringes
;
111
struct
fringe_data
**
fringe
;
112
113
/* north arrow */
114
int
draw_arrow
;
115
struct
arrow_data
*
arrow
;
116
117
/* scalebar */
118
int
num_scalebars
;
119
struct
scalebar_data
**
scalebar
;
120
121
/* background color */
122
int
bgcolor
;
123
124
}
nv_data
;
125
126
struct
render_window
{
127
#if defined(OPENGL_X11)
128
Display *
displayId
;
/* display connection */
129
GLXContext
contextId
;
/* GLX rendering context */
130
Pixmap
pixmap
;
131
GLXPixmap
windowId
;
132
#elif defined(OPENGL_AQUA)
133
#if defined(OPENGL_AGL)
134
AGLPixelFormat pixelFmtId;
135
AGLContext
contextId
;
136
AGLPbuffer
windowId
;
137
#else
138
CGLContextObj
contextId
;
139
#endif
140
#elif defined(OPENGL_WINDOWS)
141
HDC
displayId
;
/* display context */
142
HGLRC
contextId
;
/* rendering context */
143
#endif
144
int
width
,
height
;
145
};
146
147
#include <
grass/defs/nviz.h
>
148
149
#endif
/* GRASS_NVIZ_H */
config.h
nviz.h
g
float g
Definition
named_colr.c:7
ogsf.h
OGSF header file (structures)
MAX_CPLANES
#define MAX_CPLANES
Definition
ogsf.h:47
MAX_LIGHTS
#define MAX_LIGHTS
Definition
ogsf.h:46
r
double r
Definition
r_raster.c:39
arrow_data
Definition
nviz.h:83
arrow_data::where
float where[3]
Definition
nviz.h:86
arrow_data::color
unsigned long color
Definition
nviz.h:84
arrow_data::size
float size
Definition
nviz.h:85
fringe_data
Definition
nviz.h:76
fringe_data::elev
float elev
Definition
nviz.h:79
fringe_data::color
unsigned long color
Definition
nviz.h:78
fringe_data::id
int id
Definition
nviz.h:77
fringe_data::where
int where[4]
Definition
nviz.h:80
light_data
Definition
nviz.h:68
light_data::ab
float ab
Definition
nviz.h:72
light_data::w
float w
Definition
nviz.h:73
light_data::brt
float brt
Definition
nviz.h:70
light_data::b
float b
Definition
nviz.h:71
light_data::id
int id
Definition
nviz.h:69
nv_data
Definition
nviz.h:96
nv_data::scalebar
struct scalebar_data ** scalebar
Definition
nviz.h:119
nv_data::num_cplanes
int num_cplanes
Definition
nviz.h:101
nv_data::num_fringes
int num_fringes
Definition
nviz.h:110
nv_data::xyrange
float xyrange
Definition
nviz.h:98
nv_data::fringe
struct fringe_data ** fringe
Definition
nviz.h:111
nv_data::arrow
struct arrow_data * arrow
Definition
nviz.h:115
nv_data::bgcolor
int bgcolor
Definition
nviz.h:122
nv_data::draw_arrow
int draw_arrow
Definition
nviz.h:114
nv_data::num_scalebars
int num_scalebars
Definition
nviz.h:118
render_window
Definition
nviz.h:126
render_window::height
int height
Definition
nviz.h:144
render_window::pixmap
Pixmap pixmap
Definition
nviz.h:130
render_window::windowId
GLXPixmap windowId
Definition
nviz.h:131
render_window::contextId
GLXContext contextId
Definition
nviz.h:129
render_window::displayId
Display * displayId
Definition
nviz.h:128
render_window::width
int width
Definition
nviz.h:144
scalebar_data
Definition
nviz.h:89
scalebar_data::where
float where[3]
Definition
nviz.h:93
scalebar_data::id
int id
Definition
nviz.h:90
scalebar_data::color
unsigned long color
Definition
nviz.h:91
scalebar_data::size
float size
Definition
nviz.h:92
x
#define x
include
grass
nviz.h
Generated on Fri Apr 3 2026 06:59:51 for GRASS 8 Programmer's Manual by
1.9.8