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