GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
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
int
id
;
71
float
brt
;
72
float
r
,
g
,
b
;
73
float
ar, ag,
ab
;
/* ambient rgb */
74
float
x
, y, z,
w
;
/* position */
75
}
light_data
;
76
77
struct
fringe_data
{
78
int
id
;
79
unsigned
long
color
;
80
float
elev
;
81
int
where
[4];
82
};
83
84
struct
arrow_data
{
85
unsigned
long
color
;
86
float
size
;
87
float
where
[3];
88
};
89
90
struct
scalebar_data
{
91
int
id
;
92
unsigned
long
color
;
93
float
size
;
94
float
where
[3];
95
};
96
97
typedef
struct
{
98
/* ranges */
99
float
zrange,
xyrange
;
100
101
/* cplanes */
102
int
num_cplanes
;
103
int
cur_cplane, cp_on[
MAX_CPLANES
];
104
float
cp_trans[
MAX_CPLANES
][3];
105
float
cp_rot[
MAX_CPLANES
][3];
106
107
/* light */
108
light_data
light[
MAX_LIGHTS
];
109
110
/* fringe */
111
int
num_fringes
;
112
struct
fringe_data
**
fringe
;
113
114
/* north arrow */
115
int
draw_arrow
;
116
struct
arrow_data
*
arrow
;
117
118
/* scalebar */
119
int
num_scalebars
;
120
struct
scalebar_data
**
scalebar
;
121
122
/* background color */
123
int
bgcolor
;
124
125
}
nv_data
;
126
127
struct
render_window
{
128
#if defined(OPENGL_X11)
129
Display *
displayId
;
/* display connection */
130
GLXContext
contextId
;
/* GLX rendering context */
131
Pixmap
pixmap
;
132
GLXPixmap
windowId
;
133
#elif defined(OPENGL_AQUA)
134
#if defined(OPENGL_AGL)
135
AGLPixelFormat pixelFmtId;
136
AGLContext
contextId
;
137
AGLPbuffer
windowId
;
138
#else
139
CGLContextObj
contextId
;
140
#endif
141
#elif defined(OPENGL_WINDOWS)
142
HDC
displayId
;
/* display context */
143
HGLRC
contextId
;
/* rendering context */
144
#endif
145
int
width
,
height
;
146
};
147
148
#include <
grass/defs/nviz.h
>
149
150
#endif
/* GRASS_NVIZ_H */
config.h
nviz.h
g
float g
Definition:
named_colr.c:7
ogsf.h
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:84
arrow_data::where
float where[3]
Definition:
nviz.h:87
arrow_data::color
unsigned long color
Definition:
nviz.h:85
arrow_data::size
float size
Definition:
nviz.h:86
fringe_data
Definition:
nviz.h:77
fringe_data::elev
float elev
Definition:
nviz.h:80
fringe_data::color
unsigned long color
Definition:
nviz.h:79
fringe_data::id
int id
Definition:
nviz.h:78
fringe_data::where
int where[4]
Definition:
nviz.h:81
light_data
Definition:
nviz.h:69
light_data::ab
float ab
Definition:
nviz.h:73
light_data::w
float w
Definition:
nviz.h:74
light_data::brt
float brt
Definition:
nviz.h:71
light_data::b
float b
Definition:
nviz.h:72
light_data::id
int id
Definition:
nviz.h:70
nv_data
Definition:
nviz.h:97
nv_data::scalebar
struct scalebar_data ** scalebar
Definition:
nviz.h:120
nv_data::num_cplanes
int num_cplanes
Definition:
nviz.h:102
nv_data::num_fringes
int num_fringes
Definition:
nviz.h:111
nv_data::xyrange
float xyrange
Definition:
nviz.h:99
nv_data::fringe
struct fringe_data ** fringe
Definition:
nviz.h:112
nv_data::arrow
struct arrow_data * arrow
Definition:
nviz.h:116
nv_data::bgcolor
int bgcolor
Definition:
nviz.h:123
nv_data::draw_arrow
int draw_arrow
Definition:
nviz.h:115
nv_data::num_scalebars
int num_scalebars
Definition:
nviz.h:119
render_window
Definition:
nviz.h:127
render_window::height
int height
Definition:
nviz.h:145
render_window::pixmap
Pixmap pixmap
Definition:
nviz.h:131
render_window::windowId
GLXPixmap windowId
Definition:
nviz.h:132
render_window::contextId
GLXContext contextId
Definition:
nviz.h:130
render_window::displayId
Display * displayId
Definition:
nviz.h:129
render_window::width
int width
Definition:
nviz.h:145
scalebar_data
Definition:
nviz.h:90
scalebar_data::where
float where[3]
Definition:
nviz.h:94
scalebar_data::id
int id
Definition:
nviz.h:91
scalebar_data::color
unsigned long color
Definition:
nviz.h:92
scalebar_data::size
float size
Definition:
nviz.h:93
x
#define x
include
grass
nviz.h
Generated on Thu Nov 21 2024 07:03:28 for GRASS GIS 8 Programmer's Manual by
1.9.1