38#if defined(OPENGL_X11) || defined(OPENGL_WINDOWS)
41#elif defined(OPENGL_AQUA)
43#include <OpenGL/glu.h>
66static int Next_surf = 0;
67static int SDref_surf = 0;
77static float Region[4];
82static int Numlights = 0;
83static int Resetlight = 1;
84static int Modelshowing = 0;
100 static int first = 1;
104 Region[0] = wind.north;
105 Region[1] = wind.south;
106 Region[2] = wind.west;
107 Region[3] = wind.east;
110 if ((wind.east - wind.west) > (wind.north - wind.south)) {
111 Longdim = (wind.east - wind.west);
114 Longdim = (wind.north - wind.south);
119 G_debug(1,
"GS_libinit(): n=%f s=%f w=%f e=%f scale=%f first=%d", Region[0],
120 Region[1], Region[2], Region[3], Gv.scale, first);
144 G_debug(3,
"GS_get_longdim(): dim=%g", *dim);
176 G_debug(3,
"GS_set_att_defaults");
179 Default_const[i] =
defs[i];
198 G_debug(3,
"GS_surf_exists(): id=%d",
id);
204 for (i = 0; i < Next_surf && !
found; i++) {
205 if (Surf_ID[i] ==
id) {
227 G_debug(3,
"GS_new_surface():");
232 wind.south + wind.ns_res / 2., wind.rows, wind.cols,
233 wind.ew_res, wind.ns_res);
277 Gv.lights[i].position[
X] = Gv.lights[i].position[
Y] = 0.0;
278 Gv.lights[i].position[
Z] = 1.0;
279 Gv.lights[i].position[
W] = 0.0;
280 Gv.lights[i].color[0] = Gv.lights[i].color[1] =
281 Gv.lights[i].color[2] = 1.0;
282 Gv.lights[i].ambient[0] = Gv.lights[i].ambient[1] =
283 Gv.lights[i].ambient[2] = 0.2;
284 Gv.lights[i].shine = 32.0;
314 if (num < Numlights) {
315 Gv.lights[num].position[
X] =
xpos;
316 Gv.lights[num].position[
Y] =
ypos;
317 Gv.lights[num].position[
Z] =
zpos;
339 if (num < Numlights) {
340 *
xpos = Gv.lights[num].position[
X];
341 *
ypos = Gv.lights[num].position[
Y];
342 *
zpos = Gv.lights[num].position[
Z];
343 *
local = (
int)Gv.lights[num].position[
W];
360 if (num < Numlights) {
361 Gv.lights[num].color[0] = red;
362 Gv.lights[num].color[1] =
green;
363 Gv.lights[num].color[2] =
blue;
382 if (num < Numlights) {
383 *red = Gv.lights[num].color[0];
384 *
green = Gv.lights[num].color[1];
385 *
blue = Gv.lights[num].color[2];
404 if (num < Numlights) {
405 Gv.lights[num].ambient[0] = red;
406 Gv.lights[num].ambient[1] =
green;
407 Gv.lights[num].ambient[2] =
blue;
426 if (num < Numlights) {
427 *red = Gv.lights[num].ambient[0];
428 *
green = Gv.lights[num].ambient[1];
429 *
blue = Gv.lights[num].ambient[2];
443 for (i = 0; i < Numlights; i++) {
457 for (i = 0; i < Numlights; i++) {
475 if (num < Numlights) {
512 G_debug(1,
"GS_get_modelposition1(): model position: %f %f %f", pos[
X],
530 float dist,
near_h, dir[3];
532 dist = 2. * Gd.nearclip;
540 if (*size > Gd.nearclip) {
546 pos[
X] = Gv.from_to[
FROM][
X] + dir[
X] * dist;
547 pos[
Y] = Gv.from_to[
FROM][
Y] + dir[
Y] * dist;
548 pos[
Z] = Gv.from_to[
FROM][
Z] + dir[
Z] * dist;
658 style.
color = Gd.bgcol;
756 float nv[3],
pdir[2], mult;
757 float p1[2], p2[2], next[2];
780 p2[
X] =
p1[
X] + (
nv[
X] * mult);
781 p2[
Y] =
p1[
Y] + (
nv[
Y] * mult);
806 G_debug(3,
"GS_draw_flowline_at_xy(): dir: %f %f",
nv[
X],
nv[
Y]);
824 G_debug(3,
"GS_draw_fringe(): id: %d clr: %ld elev %f edges: %d %d %d %d",
825 id,
clr, elev, where[0], where[1], where[2], where[3]);
844 float *range,
int *
pt)
938 static float center[3], size;
1145 *constant =
gs->att[att].constant;
1251 if (
gs->norm_needupdate) {
1334 i =
gs->att[att].constant;
1391 gs->mask_needupdate = 1;
1437 gs->mask_needupdate = 1;
1506 return (
gs->clientdata);
1541 for (i = 0; i < Next_surf; i++) {
1542 ret[i] = Surf_ID[i];
1565 G_debug(1,
"GS_delete_surface(): id=%d",
id);
1569 for (i = 0; i < Next_surf && !
found; i++) {
1570 if (Surf_ID[i] ==
id) {
1573 for (
j = i;
j < Next_surf;
j++) {
1574 Surf_ID[
j] = Surf_ID[
j + 1];
1603 unsigned int changed;
1610 G_debug(3,
"GS_load_att_map(): map=%s", filename);
1634 if (mapset ==
NULL) {
1636 G_warning(
"Raster map <%s> not found", filename);
1646 _(
"Raster map <%s> is outside of current region. Load failed."),
1651 while (!
reuse && (0 < hdata)) {
1657 G_debug(3,
"GS_load_att_map(): %s already has data handle %d.CF=%x",
1658 filename, hdata, changed);
1672 else if (!changed) {
1681 gs->att[att].hdata = hdata;
1686 if (
gs->att[att].lookup) {
1687 free(
gs->att[att].lookup);
1688 gs->att[att].lookup =
NULL;
1693 G_debug(3,
"GS_load_att_map(): %s is being reused. hdata=%d", filename,
1698 3,
"GS_load_att_map(): %s not loaded in correct form - loading now",
1727 _(
"GS_load_att_map(): Out of memory. Unable to load map"));
1734 _(
"GS_load_att_map(): Out of memory. Unable to load map"));
1743 _(
"GS_load_att_map(): Out of memory. Unable to load map"));
1753 _(
"GS_load_att_map(): Out of memory. Unable to load map"));
1762 _(
"GS_load_att_map(): Out of memory. Unable to load map"));
1773 _(
"GS_load_att_map(): Out of memory. Unable to load map"));
1803 gs->att[att].lookup =
NULL;
1812 if (!
gs->att[att].lookup) {
1829 gs->att[att].lookup =
NULL;
1836 gs->att[att].lookup =
NULL;
1869 G_debug(3,
"GS_draw_surf(): id=%d",
id);
1904 G_debug(3,
"GS_draw_wire(): id=%d",
id);
1925 for (i = 0; i < Next_surf; i++) {
1941 for (i = 0; i < Next_surf; i++) {
1963 if (
gs->z_exag != exag) {
1964 gs->norm_needupdate = 1;
1981 G_debug(3,
"GS_set_global_exag");
1983 Gv.vert_exag = exag;
2002 G_debug(3,
"GS_global_exag(): %g", Gv.vert_exag);
2004 return (Gv.vert_exag);
2019 G_debug(3,
"GS_set_wire_color");
2066 for (i = 0; i < Next_surf; i++) {
2088 G_debug(3,
"GS_set_drawmode(): id=%d mode=%d",
id, mode);
2093 gs->draw_mode = mode;
2117 *mode =
gs->draw_mode;
2143 gs->mask_needupdate = 1;
2147 gs->nz_color = mode;
2148 gs->mask_needupdate = 1;
2175 *mode =
gs->nz_topo;
2178 *mode =
gs->nz_color;
2203 for (i = 0; i < Next_surf; i++) {
2226 G_debug(3,
"GS_set_drawres() id=%d xyres=%d/%d xywire=%d/%d",
id, xres,
2229 if (xres < 1 || yres < 1 ||
xwire < 1 ||
ywire < 1) {
2236 if (
gs->x_mod != xres ||
gs->y_mod != yres) {
2237 gs->norm_needupdate = 1;
2322 if (
gs->zrange_nz == 0.0) {
2328 G_debug(3,
"GS_get_exag_guess(): %f %f",
gs->zrange_nz, Longdim);
2330 while (
gs->zrange_nz *
guess / Longdim >= .25) {
2336 while (
gs->zrange_nz *
guess / Longdim < .025) {
2363 for (i = 0; i < Next_surf; i++) {
2371 if (
gs->zmin_nz < *
min) {
2375 if (
gs->zmax_nz > *
max) {
2381 G_debug(3,
"GS_get_zrange_nz(): min=%g max=%g", *
min, *
max);
2442 G_debug(3,
"GS_default_draw_color");
2444 return ((
unsigned int)Gd.bgcol);
2454 return ((
unsigned int)Gd.bgcol);
2573 return (Gv.infocus);
2586 G_debug(3,
"GS_set_focus_center_map");
2673 G_debug(3,
"GS_get_zextents(): id=%d",
id);
2711 *
min *= Gv.vert_exag;
2712 *
max *= Gv.vert_exag;
2728 G_debug(3,
"GS_get_from(): %f,%f,%f", fr[0], fr[1], fr[2]);
2757 to[
X] =
realto[
X] + wind.west + (wind.ew_res / 2.);
2758 to[
Y] =
realto[
Y] + wind.south + (wind.ns_res / 2.);
2887 Gv.rotate.rot_angle =
angle;
2888 Gv.rotate.rot_axes[0] =
x;
2889 Gv.rotate.rot_axes[1] = y;
2890 Gv.rotate.rot_axes[2] = z;
2891 Gv.rotate.do_rot = 1;
2901 Gv.rotate.do_rot = 0;
2911 for (i = 0; i < 16; i++) {
2912 if (i == 0 || i == 5 || i == 10 || i == 15)
2913 Gv.rotate.rotMatrix[i] = 1.0;
2915 Gv.rotate.rotMatrix[i] = 0.0;
2917 Gv.rotate.rot_angle = 0.0;
2918 Gv.rotate.rot_axes[0] = 0.0;
2919 Gv.rotate.rot_axes[1] = 0.0;
2920 Gv.rotate.rot_axes[2] = 0.0;
2921 Gv.rotate.do_rot = 0;
2931 for (i = 0; i < 16; i++) {
2932 matrix[i] = Gv.rotate.rotMatrix[i];
2943 for (i = 0; i < 16; i++) {
2944 Gv.rotate.rotMatrix[i] =
matrix[i];
2982 "GS_set_viewport(): left=%d, right=%d, "
2983 "bottom=%d, top=%d",
3007 float x, y, z, len,
los[2][3];
3066 G_debug(3,
"gs_setlos_enterdata(los): returns false");
3070 for (i = 0; i < Next_surf; i++) {
3084 tmp[
X] +=
gs->x_trans;
3085 tmp[
Y] +=
gs->y_trans;
3086 tmp[
Z] +=
gs->z_trans;
3244 *sx = *sy = Gv.scale;
3245 *sz = Gv.scale *
zexag;
3302 G_debug(3,
"GS_get_distance_alongsurf(): hs=%d p1=%f,%f p2=%f,%f",
hs, x1,
3348 static int first = 1;
3389 Gv.from_to[
TO][
Z] = 0.;
3390 Gv.from_to[
TO][
W] = Gv.from_to[
FROM][
W] = 1.;
3403 Gd.farclip = 10000.;
3434 ((
float)((
col) & 0xff)) / 255., (
float)((
col) >> 8 & 0xff) / 255.,
3435 (
float)((
col) >> 16 & 0xff) / 255., (
float)((
col) >> 24 & 0xff) / 255.);
3461 right = tmp[0] + tmp[2] - 1;
3463 top = tmp[1] + tmp[3] - 1;
3465 G_debug(3,
"GS_get_aspect(): left=%d, right=%d, top=%d, bottom=%d", left,
3468 return ((
double)(right - left) / (
top -
bottom));
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
void G_get_set_window(struct Cell_head *)
Get the current working window (region)
char * G_fully_qualified_name(const char *, const char *)
Get fully qualified element name.
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_find_raster2(const char *, const char *)
Find a raster map (look but don't touch)
int GS_v3norm(float *)
Change v1 so that it is a unit vector (3D)
void GS_v3mult(float *, float)
Multiple vectors.
int gs_malloc_lookup(geosurf *, int)
Allocate attribute lookup.
int gs_point_is_masked(geosurf *, float *)
Check if point is masked.
GLuint gsd_put_legend(const char *, GLuint, int, int *, float *, int *)
Put legend.
void gpd_obj(geosurf *, gvstyle *, Point3)
Draw point representing object.
int gs_get_zextents(geosurf *, float *, float *, float *)
Get z-extent values.
void gsd_pushmatrix(void)
Push the current matrix stack.
void gsd_real2surf(geosurf *, Point3)
Convert real to surface coordinates.
void gsd_backface(int)
ADD.
int gsds_newh(const char *)
Get handle to gsds.
void gsd_line_onsurf(geosurf *, float *, float *)
Line on surface, fix z-values.
void gsd_scale(float, float, float)
Multiply the current matrix by a general scaling matrix.
void gsd_draw_cplane(int)
Draw cplane.
int gs_getall_surfaces(geosurf **)
Get array of geosurf structs.
void gsd_do_scale(int)
Set current scale.
void gsdiff_set_SDref(geosurf *)
ADD.
int GS_v2norm(float *)
Change v1 so that it is a unit vector (2D)
void GS_v3sub(float *, float *)
Subtract vectors.
void gv_update_drapesurfs(void)
Update drape surfaces.
void gsd_draw_cplane_fence(geosurf *, geosurf *, int)
ADD.
void Gs_pack_colors(const char *, int *, int, int)
Pack color table.
void gsd_cplane_off(int)
Turn off clip plane.
void gsd_shademodel(int)
Set shaded model.
int Gs_save_3dview(const char *, geoview *, geodisplay *, struct Cell_head *, geosurf *)
Save 3dview.
int gs_get_zrange(float *, float *)
Get z-range.
void Gs_pack_colors_float(const char *, float *, int *, int, int)
Pack color table (floating-point map)
int gs_los_intersect(int, float **, float *)
Crude method of intersecting line of sight with closest part of surface.
void gsd_calllists(int)
ADD.
int gs_get_att_src(geosurf *, int)
Get attribute source.
int gsds_findh(const char *, IFLAG *, IFLAG *, int)
int Gs_update_attrange(geosurf *, int)
Update no_zero ranges for attribute (actually no_null now)
void GS_v3add(float *, float *)
Sum vectors.
void gsd_surf2real(geosurf *, Point3)
Convert surface to real coordinates.
int gs_calc_normals(geosurf *)
Calculate normals.
int GS_v3normalize(float *, float *)
Change v2 so that v1v2 is a unit vector.
int Gs_loadmap_as_short(struct Cell_head *, const char *, short *, struct BM *, int *)
Load raster map as integer map.
geosurf * gs_get_surf(int)
Get geosurf struct.
void gs_delete_surf(int)
Remove geosurf struct from list.
void gsd_deletelist(GLuint, int)
Delete list.
int gsds_set_changed(int, IFLAG)
void gsd_init_lightmodel(void)
Initialize model light.
void gsd_drawsphere(float *, unsigned long, float)
Draws a sphere at the specified center location.
int gs_get_datacenter(float *)
Get data center point.
void gsd_switchlight(int, int)
Switch light on/off.
int Gs_loadmap_as_char(struct Cell_head *, const char *, unsigned char *, struct BM *, int *)
Load raster map as integer map.
int gsds_free_data_buff(int, int)
Free allocated buffer.
void gsdiff_set_SDscale(float)
Set scale.
void gsd_calllist(int)
ADD.
void gsd_swapbuffers(void)
Swap buffers.
void GS_v3eq(float *, float *)
Copy vector values.
int Gs_load_3dview(const char *, geoview *, geodisplay *, struct Cell_head *, const geosurf *)
Load 3dview.
size_t gs_malloc_att_buff(geosurf *, int, int)
Allocate attribute buffer.
int in_vregion(geosurf *, float *)
ADD.
int Gs_loadmap_as_bitmap(struct Cell_head *, const char *, struct BM *)
Load raster map as integer map.
void gs_set_defaults(geosurf *, float *, float *)
Set default attribute values.
int gs_mapcolor(typbuff *, gsurf_att *, int)
Call this one when you already know att_src is MAP_ATT.
void gsd_cplane_setrot(int, float, float, float)
ADD.
int Gs_get_cat_label(const char *, int, int, char *)
Get categories/labels.
void gsd_get_cplanes_state(int *)
Get cplane state.
int gsd_nline_onsurf(geosurf *, float *, float *, float *, int)
Multiline on surface, fix z-values.
int gs_update_curmask(geosurf *)
Update current maps.
float gsdiff_get_SDscale(void)
Get scale.
void gsd_color_func(unsigned int)
Set current color.
int gs_set_att_src(geosurf *, int, int)
Set attribute source.
void gs_init(void)
Initialize library.
void gsd_backbuffer(void)
Draw to the back buffer.
geosurf * gs_get_new_surface(void)
Allocate new geosurf struct.
void gsd_translate(float, float, float)
Multiply the current matrix by a translation matrix.
int gs_set_att_type(geosurf *, int, int)
Set attribute type.
int gsd_wire_surf(geosurf *)
Draw surface wire.
void gsd_popmatrix(void)
Pop the current matrix stack.
void gsd_real2model(Point3)
Convert real to model coordinates.
int Gs_build_256lookup(const char *, int *)
Build color table (256)
void gsd_flush(void)
Mostly for flushing drawing commands across a network.
void gsd_set_view(geoview *, geodisplay *)
Set view.
int Gs_loadmap_as_float(struct Cell_head *, const char *, float *, struct BM *, int *)
Load raster map as floating point map.
void gsd_viewport(int, int, int, int)
Set the viewport.
void gsd_zwritemask(unsigned long)
Write out z-mask.
void gsd_linewidth(short)
Set width of rasterized lines.
int gs_num_surfaces(void)
Get number of surfaces.
int gs_distance_onsurf(geosurf *, float *, float *, float *, int)
Calculate distance on surface.
int gs_init_surf(geosurf *, double, double, int, int, double, double)
Initialize allocated geosurf struct.
void gsd_colormode(int)
Set color mode.
typbuff * gs_get_att_typbuff(geosurf *, int, int)
Get attribute data buffer.
int GS_coordpair_repeats(float *, float *, int)
ADD.
void gsd_display_fringe(geosurf *, unsigned long, float, int[4])
Display fridge.
int GS_v3dir(float *, float *, float *)
Get a normalized direction from v1 to v2, store in v3.
int _viewcell_tri_interp(geosurf *, Point3)
ADD.
int gs_get_data_avg_zmax(float *)
Get average z-max value.
int gsd_get_los(float(*)[3], short, short)
ADD.
int Gs_numtype(const char *, int *)
Get map data type.
void gsd_model2real(Point3)
Convert model to real coordinates.
int gs_set_att_const(geosurf *, int, float)
Set attribute constant value.
int gvl_get_zrange(float *, float *)
Get volume z-range value.
int gs_setlos_enterdata(Point3 *)
int gs_att_is_set(geosurf *, IFLAG)
void gsd_cplane_settrans(int, float, float, float)
ADD.
int gs_los_intersect1(int, float(*)[3], float *)
Crude method of intersecting line of sight with closest part of surface.
void gsd_deflight(int, struct lightdefs *)
Define light.
int gs_init_normbuff(geosurf *)
Init geosurf normbuff.
float GS_distance(float *, float *)
Calculate distance.
void gsd_bothbuffers(void)
Draw to the front and back buffers.
char * gsds_get_name(int)
Get name.
void gsd_frontbuffer(void)
Draw to the front buffer.
int gsd_surf(geosurf *)
ADD.
geosurf * gsdiff_get_SDref(void)
ADD.
int Gs_loadmap_as_int(struct Cell_head *, const char *, int *, struct BM *, int *)
Load raster map as integer map.
void gsd_cplane_on(int)
ADD.
void Rast_get_cellhd(const char *, const char *, struct Cell_head *)
Read the raster header.
void GS_unset_cplane(int num)
Unset clip place (turn off)
void GS_zoom_setup(int *a, int *b, int *c, int *d, int *maxx, int *maxy)
Get zoom setup.
int GS_get_twist(void)
Get twist value.
void GS_set_cplane_rot(int num, float dx, float dy, float dz)
Set cplace rotation.
int GS_get_zextents(int id, float *min, float *max, float *mid)
Get z-extent for a single surface.
int GS_setall_drawres(int xres, int yres, int xwire, int ywire)
Set all draw resolutions.
int GS_set_SDscale(float scale)
Set ?
void GS_set_global_exag(float exag)
Set global z-exag value.
int GS_new_surface(void)
Add new surface.
void GS_get_modelposition(float *size, float *pos)
Retrieves coordinates for lighting model position, at center of view.
void GS_draw_list(GLuint list_id)
Draw pre-defined list.
void GS_alldraw_cplane_fences(void)
Draw all cplace fences ?
void GS_get_zrange_nz(float *min, float *max)
Get Z extents for all loaded surfaces.
void GS_draw_X(int id, float *pt)
Draw place marker.
void GS_set_cplane_trans(int num, float dx, float dy, float dz)
Set cplace trans.
void GS_draw_surf(int id)
Draw surface.
void GS_draw_all_list(void)
Draw all glLists.
void GS_set_focus(float *realto)
Set focus.
void GS_getlight_color(int num, float *red, float *green, float *blue)
Get light color.
int GS_update_normals(int id)
Update normals.
void GS_set_infocus(void)
Set focus.
int GS_get_light_reset(void)
int GS_load_att_map(int id, const char *filename, int att)
Load raster map as attribute.
unsigned int GS_default_draw_color(void)
Get default draw color.
void GS_set_focus_real(float *realto)
Set real focus.
void GS_set_rotation_matrix(double *matrix)
Set rotation matrix.
void GS_get_from(float *fr)
Get viewpoint 'from' position.
void GS_get_dims(int id, int *rows, int *cols)
Get dimension of surface.
void GS_switchlight(int num, int on)
Switch on/off light.
void GS_draw_cplane(int num)
Draw cplace.
void GS_get_viewdir(float *dir)
Get viewdir.
void GS_alldraw_wire(void)
Draw all wires.
void GS_clear(int col)
Clear view.
void GS_getlight_ambient(int num, float *red, float *green, float *blue)
Get light ambient.
void GS_init_rotation(void)
Reset scene rotation.
void GS_set_focus_center_map(int id)
Set focus to map center.
int GS_set_drawres(int id, int xres, int yres, int xwire, int ywire)
Set draw resolution for surface.
int GS_look_here(int sx, int sy)
Send screen coords sx and sy, lib traces through surfaces; sets new center to point of nearest inters...
void GS_set_cplane(int num)
Set cplace.
int GS_get_att(int id, int att, int *set, float *constant, char *mapname)
Get attributes.
int GS_delete_surface(int id)
Delete surface.
int GS_update_curmask(int id)
Update current mask.
int * GS_get_surf_list(int *numsurfs)
Get surface list.
int GS_get_SDscale(float *scale)
Get ?
double GS_get_aspect(void)
Get aspect value.
int GS_get_selected_point_on_surface(int sx, int sy, int *id, float *x, float *y, float *z)
Get selected point of surface.
int GS_get_SDsurf(int *id)
Get ?
int GS_new_light(void)
Add new model light.
int GS_draw_nline_onsurf(int id, float x1, float y1, float x2, float y2, float *lasp, int n)
Draw multiline on surface.
void GS_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
Get translation values (surface position)
int GS_get_distance_alongsurf(int hs, float x1, float y1, float x2, float y2, float *dist, int use_exag)
Measure distance "as the ball rolls" between two points on surface.
int GS_get_zrange(float *min, float *max, int doexag)
Get z-extent for all loaded surfaces.
int GS_save_3dview(const char *vname, int surfid)
Save 3d view.
int GS_get_val_at_xy(int id, int att, char *valstr, float x, float y)
Get RGB color at given point.
void GS_draw_line_onsurf(int id, float x1, float y1, float x2, float y2)
Draw line on surface.
void GS_set_viewdir(float *dir)
Set viewdir.
void GS_draw_flowline_at_xy(int id, float x, float y)
Draw flow-line on surace.
void GS_moveto(float *pt)
Move viewpoint.
void GS_get_scale(float *sx, float *sy, float *sz, int doexag)
Get axis scale.
int GS_get_fov(void)
Get field of view.
int GS_transp_is_set(void)
Check if transparency is set.
void GS_libinit(void)
Initialize OGSF library.
void GS_setlight_color(int num, float red, float green, float blue)
Set light color.
int GS_get_fencecolor(void)
Get fence color.
int GS_get_nozero(int id, int att, int *mode)
Get no-zero ?
void GS_set_trans(int id, float xtrans, float ytrans, float ztrans)
Set translation (surface position)
int GS_get_region(float *n, float *s, float *w, float *e)
Get 2D region extent.
void GS_get_drawres(int id, int *xres, int *yres, int *xwire, int *ywire)
Get draw resolution of surface.
void GS_delete_list(GLuint list_id)
Delete pre-defined list.
void GS_get_rotation_matrix(double *matrix)
Get rotation matrix.
void GS_unset_SDsurf(void)
Unset Scaled Difference surface.
void GS_set_nozero(int id, int att, int mode)
Set no-zero ?
void GS_set_Narrow(int *pt, int id, float *pos2)
Set decoration, north arrow ??
int GS_get_focus(float *realto)
Get focus.
int GS_num_surfs(void)
Get number of surfaces.
void GS_draw_fringe(int id, unsigned long clr, float elev, int *where)
Draw fringe around data (surface) at selected corners.
void GS_unset_rotation(void)
Stop scene rotation.
int GS_get_wire_color(int id, int *colr)
Get wire color.
int GS_is_masked(int id, float *pt)
Check if point is masked ?
void GS_draw_lighting_model(void)
Draw lighting model.
void GS_set_fencecolor(int mode)
Set fence color.
int GS_get_exag_guess(int id, float *exag)
Get exag-value guess.
void GS_set_rotation(double angle, double x, double y, double z)
Set rotation params.
void GS_set_light_reset(int i)
int GS_get_maskmode(int id, int *mode)
Get mask mode.
int GS_get_drawmode(int id, int *mode)
Get draw mode.
void GS_get_to(float *to)
Get 'to' model coordinates.
void GS_set_wire_color(int id, int colr)
Set wire color.
void GS_lights_on(void)
Switch on all lights.
void GS_set_exag(int id, float exag)
Set Z exag for surface.
int GS_surf_exists(int id)
int gsd_getViewport(GLint *, GLint *)
int GS_draw_cplane_fence(int hs1, int hs2, int num)
Draw cplace fence ?
void GS_setlight_position(int num, float xpos, float ypos, float zpos, int local)
Set light position.
unsigned int GS_background_color(void)
Get background color.
int GS_set_drawmode(int id, int mode)
Set draw mode.
void GS_alldraw_surf(void)
Draw all surfaces.
int GS_setall_drawmode(int mode)
Set all draw-modes.
void GS_init_view(void)
Init viewpoint.
int GS_set_SDsurf(int id)
Set surface as Scaled Difference surface.
void GS_setlight_ambient(int num, float red, float green, float blue)
Set light ambient.
void GS_set_draw(int where)
Sets which buffer to draw to.
int GS_get_cat_at_xy(int id, int att, char *catstr, float x, float y)
Get surface category on given position.
int GS_draw_legend(const char *name, GLuint fontbase, int size, int *flags, float *range, int *pt)
Draw legend.
void GS_moveto_real(float *pt)
Move position to (real)
void GS_get_from_real(float *fr)
Get viewpoint 'from' real coordinates.
int GS_set_att_const(int id, int att, float constant)
Set attribute constant.
int GS_Set_ClientData(int id, void *clientd)
Set client data.
int GS_load_3dview(const char *vname, int surfid)
Load 3d view.
void GS_set_att_defaults(float *defs, float *null_defs)
Set default attributes for map objects.
void GS_draw_lighting_model1(void)
Draw lighting model.
void GS_set_nofocus(void)
Unset focus.
int GS_get_longdim(float *dim)
Get largest dimension.
int GS_unset_att(int id, int att)
Unset attribute.
void GS_set_viewport(int left, int right, int bottom, int top)
Set viewport.
void GS_getlight_position(int num, float *xpos, float *ypos, float *zpos, int *local)
Get light position.
void GS_done_draw(void)
Draw done, swap buffers.
void GS_set_fov(int fov)
Set field of view.
void GS_get_modelposition1(float pos[])
Retrieves coordinates for lighting model position, at center of view.
int GS_get_norm_at_xy(int id, float x, float y, float *nv)
Get surface normal at x,y (real coordinates)
int GS_set_maskmode(int id, int mode)
Set mask mode.
void * GS_Get_ClientData(int id)
Get client data.
int GS_has_transparency(void)
Check for transparency.
void GS_draw_wire(int id)
Draw surface wire.
void GS_lights_off(void)
Switch off all lights.
void GS_get_to_real(float *to)
Get 'to' real coordinates.
void GS_set_twist(int t)
Set viewpoint twist value.
float GS_global_exag(void)
Get global z-exag value.
#define GET_MAPATT(buff, offset, att)
OGSF header file (structures)
#define DRC2OFF(gs, drow, dcol)
#define VROW2DROW(gs, vrow)
#define VCOL2DCOL(gs, vcol)
2D/3D raster map header (used also for region)
double bottom
Extent coordinates (bottom) - 3D data.
double top
Extent coordinates (top) - 3D data.
int rows
Number of rows for 2D data.
int cols
Number of columns for 2D data.
Struct for vector feature displaying attributes.
int symbol
Point symbol/line type.