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 */
68typedef 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 */
75
77 int id;
78 unsigned long color;
79 float elev;
80 int where[4];
81};
82
83struct arrow_data {
84 unsigned long color;
85 float size;
86 float where[3];
87};
88
90 int id;
91 unsigned long color;
92 float size;
93 float where[3];
94};
95
96typedef struct {
97 /* ranges */
98 float zrange, xyrange;
99
100 /* 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 */
108
109 /* fringe */
112
113 /* north arrow */
116
117 /* scalebar */
120
121 /* background color */
123
124} nv_data;
125
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
145};
146
147#include <grass/defs/nviz.h>
148
149#endif /* GRASS_NVIZ_H */
float g
Definition named_colr.c:7
OGSF header file (structures)
#define MAX_CPLANES
Definition ogsf.h:47
#define MAX_LIGHTS
Definition ogsf.h:46
double r
Definition r_raster.c:39
float where[3]
Definition nviz.h:86
unsigned long color
Definition nviz.h:84
float size
Definition nviz.h:85
float elev
Definition nviz.h:79
unsigned long color
Definition nviz.h:78
int id
Definition nviz.h:77
int where[4]
Definition nviz.h:80
float ab
Definition nviz.h:72
float w
Definition nviz.h:73
float brt
Definition nviz.h:70
float b
Definition nviz.h:71
int id
Definition nviz.h:69
Definition nviz.h:96
struct scalebar_data ** scalebar
Definition nviz.h:119
int num_cplanes
Definition nviz.h:101
int num_fringes
Definition nviz.h:110
float xyrange
Definition nviz.h:98
struct fringe_data ** fringe
Definition nviz.h:111
struct arrow_data * arrow
Definition nviz.h:115
int bgcolor
Definition nviz.h:122
int draw_arrow
Definition nviz.h:114
int num_scalebars
Definition nviz.h:118
int height
Definition nviz.h:144
Pixmap pixmap
Definition nviz.h:130
GLXPixmap windowId
Definition nviz.h:131
GLXContext contextId
Definition nviz.h:129
Display * displayId
Definition nviz.h:128
int width
Definition nviz.h:144
float where[3]
Definition nviz.h:93
unsigned long color
Definition nviz.h:91
float size
Definition nviz.h:92
#define x