37 #if defined(OPENGL_X11) || defined(OPENGL_WINDOWS) 40 #elif defined(OPENGL_AQUA) 41 #include <OpenGL/gl.h> 42 #include <OpenGL/glu.h> 65 static int Next_surf = 0;
66 static int SDref_surf = 0;
69 static float Default_const[
MAX_ATTS];
70 static float Default_nulls[
MAX_ATTS];
76 static float Region[4];
80 static int Buffermode;
81 static int Numlights = 0;
82 static int Resetlight = 1;
83 static int Modelshowing = 0;
103 Region[0] = wind.
north;
104 Region[1] = wind.
south;
105 Region[2] = wind.
west;
106 Region[3] = wind.
east;
118 G_debug(1,
"GS_libinit(): n=%f s=%f w=%f e=%f scale=%f first=%d",
119 Region[0], 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];
180 Default_nulls[i] = null_defs[i];
198 G_debug(3,
"GS_surf_exists(): id=%d",
id);
205 for (i = 0; i < Next_surf && !found; i++) {
206 if (Surf_ID[i] ==
id) {
228 G_debug(3,
"GS_new_surface():");
314 if (num < Numlights) {
340 if (num < Numlights) {
362 if (num < Numlights) {
384 if (num < Numlights) {
406 if (num < Numlights) {
428 if (num < Numlights) {
446 for (i = 0; i < Numlights; i++) {
460 for (i = 0; i < Numlights; i++) {
478 if (num < Numlights) {
515 G_debug(1,
"GS_get_modelposition1(): model position: %f %f %f",
516 pos[
X], pos[
Y], pos[Z]);
533 float dist, near_h, dir[3];
537 near_h = 2.0 * tan(4.0 * atan(1.) * Gv.
fov / 3600.) * dist;
572 GLdouble modelMatrix[16], projMatrix[16];
580 pos2[Y] = (
float)y - gs->
oy + gs->
y_trans;
594 glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix);
595 glGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
596 glGetIntegerv(GL_VIEWPORT, viewport);
599 GLdouble out_near[3], out_far[3];
605 gluUnProject((GLdouble) pt[
X], (GLdouble) pt[Y], (GLdouble) 0.,
606 modelMatrix, projMatrix, viewport,
607 &out_near[
X], &out_near[
Y], &out_near[
Z]);
608 gluUnProject((GLdouble) pt[X], (GLdouble) pt[Y], (GLdouble) 1.,
609 modelMatrix, projMatrix, viewport,
610 &out_far[X], &out_far[Y], &out_far[
Z]);
614 factor = (out_near[
Z] - z) / (out_near[Z] - out_far[Z]);
616 out[
X] = out_near[
X] - ((out_near[
X] - out_far[
X]) * factor);
617 out[
Y] = out_near[
Y] - ((out_near[
Y] - out_far[
Y]) * factor);
620 pos2[
X] = (float)out[X];
621 pos2[
Y] = (float)out[Y];
622 pos2[
Z] = (float)out[Z];
648 style.
size = siz / 200.;
649 pos[
X] = pt[
X] - gs->
ox;
650 pos[
Y] = pt[
Y] - gs->
oy;
759 float nv[3], pdir[2], mult;
760 float p1[2], p2[2], next[2];
773 if (pdir[X] == 0.0 && pdir[Y] == 0.0) {
777 p2[
X] = p1[
X] + (pdir[
X] * mult);
778 p2[
Y] = p1[
Y] + (pdir[
Y] * mult);
783 p2[
X] = p1[
X] + (nv[
X] * mult);
784 p2[
Y] = p1[
Y] + (nv[
Y] * mult);
801 p2[X], p2[Y], next, 3)) {
809 G_debug(3,
"GS_draw_flowline_at_xy(): dir: %f %f", nv[X], nv[Y]);
827 G_debug(3,
"GS_draw_fringe(): id: %d clr: %ld elev %f edges: %d %d %d %d",
828 id, clr, elev, where[0], where[1], where[2], where[3]);
849 float *range,
int *pt)
903 static float center[3];
943 static float center[3], size;
944 float tcenter[3], tsize;
1021 tmp[
X] = pt[
X] - gs->
ox;
1022 tmp[
Y] = pt[
Y] - gs->
oy;
1140 int GS_get_att(
int id,
int att,
int *
set,
float *constant,
char *mapname)
1185 int offset, drow, dcol, vrow, vcol;
1210 sprintf(catstr,
_(
"no category info"));
1221 offset =
DRC2OFF(gs, drow, dcol);
1226 drow, dcol, catstr));
1229 sprintf(catstr,
_(
"no data"));
1248 int offset, drow, dcol, vrow, vcol;
1279 offset =
DRC2OFF(gs, drow, dcol);
1312 int offset, drow, dcol, vrow, vcol;
1342 sprintf(valstr,
"R%d G%d B%d",
1362 offset =
DRC2OFF(gs, drow, dcol);
1370 sprintf(valstr,
"R%d G%d B%d",
1374 sprintf(valstr,
"%f", ftmp);
1380 sprintf(valstr,
"NULL");
1543 *numsurfs = Next_surf;
1546 ret = (
int *)
G_malloc(Next_surf *
sizeof(
int));
1548 for (i = 0; i < Next_surf; i++) {
1549 ret[i] = Surf_ID[i];
1572 G_debug(1,
"GS_delete_surface(): id=%d",
id);
1576 for (i = 0; i < Next_surf && !found; i++) {
1577 if (Surf_ID[i] ==
id) {
1580 for (j = i; j < Next_surf; j++) {
1581 Surf_ID[j] = Surf_ID[j + 1];
1611 unsigned int changed;
1615 int reuse, begin, hdata, ret, neg, has_null;
1618 G_debug(3,
"GS_load_att_map(): map=%s", filename);
1620 reuse = ret = neg = has_null = 0;
1642 if (mapset ==
NULL) {
1644 G_warning(
"Raster map <%s> not found", filename);
1654 G_warning(
_(
"Raster map <%s> is outside of current region. Load failed."),
1658 while (!reuse && (0 < hdata)) {
1662 if (0 < (hdata =
gsds_findh(filename, &changed, &atty, begin))) {
1664 G_debug(3,
"GS_load_att_map(): %s already has data handle %d.CF=%x",
1665 filename, hdata, changed);
1679 else if (!changed) {
1700 G_debug(3,
"GS_load_att_map(): %s is being reused. hdata=%d",
1704 G_debug(3,
"GS_load_att_map(): %s not loaded in correct form - loading now",
1732 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1738 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1746 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1750 tbuff->
nm, &has_null);
1755 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1759 tbuff->
nm, &has_null);
1763 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1767 tbuff->
nm, &has_null);
1773 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1777 tbuff->
nm, &has_null);
1787 G_debug(4,
" has_null=%d", has_null);
1807 Gs_build_lookup(filename, gs->
att[att].
lookup);
1821 G_fatal_error(
_(
"GS_load_att_map(): Out of memory. Unable to load map"));
1868 G_debug(3,
"GS_draw_surf(): id=%d",
id);
1903 G_debug(3,
"GS_draw_wire(): id=%d",
id);
1924 for (i = 0; i < Next_surf; i++) {
1940 for (i = 0; i < Next_surf; i++) {
1962 if (gs->
z_exag != exag) {
1980 G_debug(3,
"GS_set_global_exag");
2018 G_debug(3,
"GS_set_wire_color");
2065 for (i = 0; i < Next_surf; i++) {
2087 G_debug(3,
"GS_set_drawmode(): id=%d mode=%d",
id, mode);
2202 for (i = 0; i < Next_surf; i++) {
2225 G_debug(3,
"GS_set_drawres() id=%d xyres=%d/%d xywire=%d/%d",
2226 id, xres, yres, xwire, ywire);
2228 if (xres < 1 || yres < 1 || xwire < 1 || ywire < 1) {
2235 if (gs->
x_mod != xres || gs->
y_mod != yres) {
2329 while (gs->
zrange_nz * guess / Longdim >= .25) {
2332 G_debug(3,
"GS_get_exag_guess(): %f", guess);
2335 while (gs->
zrange_nz * guess / Longdim < .025) {
2338 G_debug(3,
"GS_get_exag_guess(): %f", guess);
2362 for (i = 0; i < Next_surf; i++) {
2380 G_debug(3,
"GS_get_zrange_nz(): min=%g max=%g", *min, *max);
2403 G_debug(3,
"GS_set_trans(): id=%d, x=%f, y=%f, z=%f",
2404 id, xtrans, ytrans, ztrans);
2427 G_debug(3,
"GS_get_trans: id=%d, x=%f, y=%f, z=%f",
2428 id, *xtrans, *ytrans, *ztrans);
2442 G_debug(3,
"GS_default_draw_color");
2444 return ((
unsigned int)Gd.
bgcol);
2454 return ((
unsigned int)Gd.
bgcol);
2523 G_debug(3,
"GS_set_focus(): %f,%f,%f", realto[0], realto[1], realto[2]);
2542 realto[
X] = realto[
X] - wind.
west - (wind.
ew_res / 2.);
2587 G_debug(3,
"GS_set_focus_center_map");
2621 G_debug(3,
"GS_moveto(): %f,%f,%f", pt[0], pt[1], pt[2]);
2674 G_debug(3,
"GS_get_zextents(): id=%d",
id);
2691 int ret_surf, ret_vol;
2692 float surf_min, surf_max;
2693 float vol_min, vol_max;
2698 if (ret_surf > 0 && ret_vol > 0) {
2699 *min = (surf_min < vol_min) ? surf_min : vol_min;
2700 *max = (surf_max < vol_max) ? surf_max : vol_max;
2702 else if (ret_surf > 0) {
2706 else if (ret_vol > 0) {
2716 G_debug(3,
"GS_get_zrange(): min=%g max=%g", *min, *max);
2717 return ((ret_surf > 0 || ret_vol > 0) ? (1) : (-1));
2729 G_debug(3,
"GS_get_from(): %f,%f,%f", fr[0], fr[1], fr[2]);
2913 for (i = 0; i < 16; i++) {
2914 if (i == 0 || i == 5 || i == 10 || i == 15)
2933 for (i = 0; i < 16; i++) {
2945 for (i = 0; i < 16; i++) {
2983 G_debug(3,
"GS_set_viewport(): left=%d, right=%d, " 2984 "bottom=%d, top=%d", left, right, bottom, top);
3007 float x, y, z, len, los[2][3];
3057 float los[2][3], find_dist[
MAX_SURFS], closest;
3059 int surfs[
MAX_SURFS], i, iclose, numhits = 0;
3066 G_debug(3,
"gs_setlos_enterdata(los): returns false");
3070 for (i = 0; i < Next_surf; i++) {
3089 GS_v3eq(finds[numhits], point);
3090 surfs[numhits] = Surf_ID[i];
3096 for (i = iclose = 0; i < numhits; i++) {
3097 closest = find_dist[iclose];
3099 if (find_dist[i] < closest) {
3105 *x = finds[iclose][
X];
3106 *y = finds[iclose][
Y];
3107 *z = finds[iclose][
Z];
3108 *
id = surfs[iclose];
3111 G_debug(3,
"NumHits %d, next %d", numhits, Next_surf);
3245 *sx = *sy = Gv.
scale;
3246 *sz = Gv.
scale * zexag;
3286 float *dist,
int use_exag)
3303 G_debug(3,
"GS_get_distance_alongsurf(): hs=%d p1=%f,%f p2=%f,%f",
3304 hs, x1, y1, x2, y2);
3349 static int first = 1;
3355 glMatrixMode(GL_MODELVIEW);
3374 glDepthRange(0.0, 1.0);
3375 glEnable(GL_DEPTH_TEST);
3376 glDepthFunc(GL_LEQUAL);
3422 col = col | 0xFF000000;
3434 glClearColor(((
float)((col) & 0xff)) / 255.,
3435 (
float)((col) >> 8 & 0xff) / 255.,
3436 (
float)((col) >> 16 & 0xff) / 255.,
3437 (
float)((col) >> 24 & 0xff) / 255.);
3438 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
3461 glGetIntegerv(GL_VIEWPORT, tmp);
3463 right = tmp[0] + tmp[2] - 1;
3465 top = tmp[1] + tmp[3] - 1;
3467 G_debug(3,
"GS_get_aspect(): left=%d, right=%d, top=%d, bottom=%d",
3468 left, right, top, bottom);
3470 return ((
double)(right - left) / (top - bottom));
int GS_set_maskmode(int id, int mode)
Set mask mode.
int gs_mapcolor(typbuff *, gsurf_att *, int)
Call this one when you already know att_src is MAP_ATT.
int GS_coordpair_repeats(float *, float *, int)
ADD.
int gsds_findh(const char *, IFLAG *, IFLAG *, int)
Get handle to gsds.
int GS_Set_ClientData(int id, void *clientd)
Set client data.
geosurf * gs_get_surf(int)
Get geosurf struct.
int GS_get_zextents(int id, float *min, float *max, float *mid)
Get z-extent for a single surface.
void Gs_pack_colors(const char *, int *, int, int)
Pack color table.
void gsd_frontbuffer(void)
Draw to the front buffer.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void GS_set_nozero(int id, int att, int mode)
Set no-zero ?
int Gs_loadmap_as_int(struct Cell_head *, const char *, int *, struct BM *, int *)
Load raster map as integer map.
int gsds_newh(const char *)
Get handle to gsds.
void gsd_flush(void)
Mostly for flushing drawing commands across a network.
void gsd_surf2real(geosurf *, Point3)
Convert surface to real coordinates.
int gs_distance_onsurf(geosurf *, float *, float *, float *, int)
Calculate distance on surface.
void GS_get_to(float *to)
Get 'to' model coordinates.
int GS_get_fov(void)
Get fied of view.
int gs_getall_surfaces(geosurf **)
Get array of geosurf structs.
#define DRC2OFF(gs, drow, dcol)
int GS_load_3dview(const char *vname, int surfid)
Load 3d view.
int gs_get_datacenter(float *)
Get data center point.
int GS_set_SDscale(float scale)
Set ?
void GS_get_from(float *fr)
Get viewpoint 'from' position.
void GS_get_rotation_matrix(double *matrix)
Get rotation matrix.
void GS_get_modelposition(float *siz, float *pos)
Retrieves coordinates for lighting model position, at center of view.
void GS_alldraw_cplane_fences(void)
Draw all cplace fences ?
void GS_v3sub(float *, float *)
Subtract vectors.
void GS_get_scale(float *sx, float *sy, float *sz, int doexag)
Get axis scale.
int GS_new_surface(void)
Add new surface.
int Gs_update_attrange(geosurf *, int)
Update no_zero ranges for attribute (actually no_null now)
void GS_getlight_color(int num, float *red, float *green, float *blue)
Get light color.
unsigned int GS_default_draw_color(void)
Get default draw color.
void GS_draw_list(GLuint list_id)
Draw pre-defined list.
int _viewcell_tri_interp(geosurf *, Point3)
ADD.
2D/3D raster map header (used also for region)
int gs_get_data_avg_zmax(float *)
Get average z-max value.
void GS_get_drawres(int id, int *xres, int *yres, int *xwire, int *ywire)
Get draw resolution of surface.
void GS_moveto_real(float *pt)
Move position to (real)
void gsd_switchlight(int, int)
Switch light on/off.
void GS_draw_wire(int id)
Draw surface wire.
int gs_los_intersect1(int, float(*)[3], float *)
Crude method of intersecting line of sight with closest part of surface.
int GS_get_maskmode(int id, int *mode)
Get mask mode.
int gs_get_zrange(float *, float *)
Get z-range.
int Gs_get_cat_label(const char *, int, int, char *)
Get categories/labels.
void * GS_Get_ClientData(int id)
Get client data.
void GS_draw_flowline_at_xy(int id, float x, float y)
Draw flow-line on surace.
int gs_set_att_type(geosurf *, int, int)
Set attribute type.
int GS_get_zrange(float *min, float *max, int doexag)
Get z-extent for all loaded surfaces.
int GS_draw_cplane_fence(int hs1, int hs2, int num)
Draw cplace fence ?
double west
Extent coordinates (west)
int gsd_get_los(float(*)[3], short, short)
ADD.
void GS_set_rotation(double angle, double x, double y, double z)
Set rotation params.
int GS_get_exag_guess(int id, float *exag)
Get exag-value guess.
int gs_setlos_enterdata(Point3 *)
void gs_delete_surf(int)
Remove geosurf struct from list.
void GS_draw_lighting_model1(void)
Draw lighting model.
void gsd_popmatrix(void)
Pop the current matrix stack.
void GS_set_focus_real(float *realto)
Set real focus.
void GS_setlight_position(int num, float xpos, float ypos, float zpos, int local)
Set light position.
int gs_get_att_src(geosurf *, int)
Get attribute source.
void GS_set_fencecolor(int mode)
Set fence color.
int gsd_nline_onsurf(geosurf *, float *, float *, float *, int)
Multiline on surface, fix z-values.
int gsds_free_data_buff(int, int)
Free allocated buffer.
void gsd_real2model(Point3)
Convert real to model coordinates.
int GS_get_SDscale(float *scale)
Get ?
void GS_draw_all_list(void)
Draw all glLists.
void gsdiff_set_SDref(geosurf *)
ADD.
int Gs_loadmap_as_char(struct Cell_head *, const char *, unsigned char *, struct BM *, int *)
Load raster map as integer map.
void GS_v3add(float *, float *)
Sum vectors.
int GS_get_wire_color(int id, int *colr)
Get wire color.
void GS_set_Narrow(int *pt, int id, float *pos2)
Set decoration, north arrow ??
int GS_save_3dview(const char *vname, int surfid)
Save 3d view.
int Gs_loadmap_as_bitmap(struct Cell_head *, const char *, struct BM *)
Load raster map as integer map.
void GS_set_trans(int id, float xtrans, float ytrans, float ztrans)
Set translation (surface position)
void gsd_deflight(int, struct lightdefs *)
Define light.
void GS_zoom_setup(int *a, int *b, int *c, int *d, int *maxx, int *maxy)
Get zoom setup.
void GS_getlight_position(int num, float *xpos, float *ypos, float *zpos, int *local)
Get light position.
int GS_get_selected_point_on_surface(int sx, int sy, int *id, float *x, float *y, float *z)
Get selected point of surface.
void GS_set_viewdir(float *dir)
Set viewdir.
int gvl_get_zrange(float *, float *)
Get volume z-range value.
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.
void GS_set_global_exag(float exag)
Set global z-exag value.
int GS_set_att_const(int id, int att, float constant)
Set attribute constant.
void gsd_shademodel(int)
Set shaded model.
double GS_get_aspect(void)
Get aspect value.
int GS_draw_legend(const char *name, GLuint fontbase, int size, int *flags, float *range, int *pt)
Draw legend.
int GS_update_curmask(int id)
Update current mask.
int GS_v3normalize(float *, float *)
Change v2 so that v1v2 is a unit vector.
void gsd_cplane_off(int)
Turn off clip plane.
void GS_init_rotation(void)
Reset scene rotation.
void GS_moveto(float *pt)
Move viewpoint.
int GS_surf_exists(int id)
void GS_set_focus(float *realto)
Set focus.
void gsd_calllist(int)
ADD.
int Gs_save_3dview(const char *, geoview *, geodisplay *, struct Cell_head *, geosurf *)
Save 3dview.
void GS_get_from_real(float *fr)
Get viewpoint 'from' real coordinates.
void GS_get_dims(int id, int *rows, int *cols)
Get dimension of surface.
void gsd_get_cplanes_state(int *)
Get cplane state.
int GS_setall_drawmode(int mode)
Set all draw-modes.
int GS_get_twist(void)
Get twist value.
int GS_v3norm(float *)
Change v1 so that it is a unit vector (2D)
int GS_get_focus(float *realto)
Get focus.
double top
Extent coordinates (top) - 3D data.
void GS_set_infocus(void)
Set focus.
void GS_set_nofocus(void)
Unset focus.
void GS_switchlight(int num, int on)
Switch on/off light.
void gsd_cplane_setrot(int, float, float, float)
ADD.
float GS_distance(float *, float *)
Calculate distance.
void gsd_draw_cplane(int)
Draw cplane.
void GS_set_light_reset(int i)
void gsd_init_lightmodel(void)
Initialize model light.
void GS_unset_rotation(void)
Stop scene rotation.
void gpd_obj(geosurf *, gvstyle *, Point3)
Draw point representing object.
void Gs_pack_colors_float(const char *, float *, int *, int, int)
Pack color table (floating-point map)
int gs_set_att_const(geosurf *, int, float)
Set attribute constant value.
void gsd_colormode(int)
Set color mode.
int GS_get_cat_at_xy(int id, int att, char *catstr, float x, float y)
Get surface category on given position.
double north
Extent coordinates (north)
int GS_set_SDsurf(int id)
Set surface as Scaled Difference surface.
int Gs_build_256lookup(const char *, int *)
Build color table (256)
void GS_set_viewport(int left, int right, int bottom, int top)
Set viewport.
int GS_update_normals(int id)
Update normals.
int GS_get_norm_at_xy(int id, float x, float y, float *nv)
Get surface normal at x,y (real coordinates)
int gsds_set_changed(int, IFLAG)
ADD.
void GS_draw_X(int id, float *pt)
Draw place marker.
char * G_fully_qualified_name(const char *, const char *)
Get fully qualified element name.
void GS_set_twist(int t)
Set viewpoint twist value.
void gs_set_defaults(geosurf *, float *, float *)
Set default attribute values.
int in_vregion(geosurf *, float *)
ADD.
void gsd_backface(int)
ADD.
void gsdiff_set_SDscale(float)
Set scale.
void gsd_color_func(unsigned int)
Set current color.
int gs_update_curmask(geosurf *)
Update current maps.
void GS_getlight_ambient(int num, float *red, float *green, float *blue)
Get light ambient.
void gsd_set_view(geoview *, geodisplay *)
Set view.
int GS_setall_drawres(int xres, int yres, int xwire, int ywire)
Set all draw resolutions.
double south
Extent coordinates (south)
void gs_init(void)
Initialize library.
int Gs_load_3dview(const char *, geoview *, geodisplay *, struct Cell_head *, geosurf *)
Load 3dview.
void GS_delete_list(GLuint list_id)
Delete pre-defined list.
void gsd_translate(float, float, float)
Multiply the current matrix by a translation matrix.
void gsd_viewport(int, int, int, int)
Set the viewport.
int GS_new_light(void)
Add new model light.
void GS_set_cplane_trans(int num, float dx, float dy, float dz)
Set cplace trans.
void gsd_bothbuffers(void)
Draw to the front and back buffers.
void gsd_line_onsurf(geosurf *, float *, float *)
Line on surface, fix z-values.
void GS_set_wire_color(int id, int colr)
Set wire color.
int GS_get_region(float *n, float *s, float *w, float *e)
Get 2D region extent.
int GS_v2norm(float *)
Change v1 so that it is a unit vector (3D)
void GS_clear(int col)
Clear view.
int gs_num_surfaces(void)
Get number of surfaces.
int GS_num_surfs(void)
Get number of surfaces.
float gsdiff_get_SDscale(void)
Get scale.
double bottom
Extent coordinates (bottom) - 3D data.
void gsd_draw_cplane_fence(geosurf *, geosurf *, int)
ADD.
int gs_get_zextents(geosurf *, float *, float *, float *)
Get z-extent values.
void GS_set_att_defaults(float *defs, float *null_defs)
Set default attributes for map objects.
int GS_get_longdim(float *dim)
Get largest dimension.
void G_get_set_window(struct Cell_head *)
Get the current working window (region)
int GS_set_drawmode(int id, int mode)
Set draw mode.
int GS_get_drawmode(int id, int *mode)
Get draw mode.
unsigned int GS_background_color(void)
Get background color.
int gs_init_normbuff(geosurf *)
Init geosurf normbuff.
int Gs_numtype(const char *, int *)
Get map data type.
void gsd_backbuffer(void)
Draw to the back buffer.
void GS_draw_fringe(int id, unsigned long clr, float elev, int *where)
Draw fringe around data (surface) at selected corners.
size_t gs_malloc_att_buff(geosurf *, int, int)
Allocate attribute buffer.
void GS_get_viewdir(float *dir)
Get viewdir.
int Gs_loadmap_as_float(struct Cell_head *, const char *, float *, struct BM *, int *)
Load raster map as floating point map.
void gsd_cplane_on(int)
ADD.
void gv_update_drapesurfs(void)
Update drape surfaces.
void GS_init_view(void)
Init viewpoint.
int GS_is_masked(int id, float *pt)
Check if point is masked ?
void GS_set_cplane_rot(int num, float dx, float dy, float dz)
Set cplace rotation.
int GS_get_att(int id, int att, int *set, float *constant, char *mapname)
Get attributes.
int GS_load_att_map(int id, const char *filename, int att)
Load raster map as attribute.
void gsd_zwritemask(unsigned long)
Write out z-mask.
void GS_set_focus_center_map(int id)
Set focus to map center.
typbuff * gs_get_att_typbuff(geosurf *, int, int)
Get attribute data buffer.
void GS_draw_cplane(int num)
Draw cplace.
int Gs_loadmap_as_short(struct Cell_head *, const char *, short *, struct BM *, int *)
Load raster map as integer map.
int gs_malloc_lookup(geosurf *, int)
Allocate attribute lookup.
float GS_global_exag(void)
Get global z-exag value.
int cols
Number of columns for 2D data.
void GS_unset_cplane(int num)
Unset clip place (turn off)
void Rast_get_cellhd(const char *, const char *, struct Cell_head *)
Read the raster header.
void GS_v3eq(float *, float *)
Copy vector values.
void GS_set_draw(int where)
Sets which buffer to draw to.
int gs_point_is_masked(geosurf *, float *)
Check if point is masked.
void gsd_linewidth(short)
Set width of rasterized lines.
void GS_get_zrange_nz(float *min, float *max)
Get Z extents for all loaded surfaces.
void GS_set_rotation_matrix(double *matrix)
Set rotation matrix.
void GS_draw_surf(int id)
Draw surface.
void gsd_calllists(int)
ADD.
double ns_res
Resolution - north to south cell size for 2D data.
void GS_draw_lighting_model(void)
Draw lighting model.
void GS_lights_off(void)
Switch off all lights.
void GS_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
Get translation values (surface position)
void G_warning(const char *,...) __attribute__((format(printf
void GS_alldraw_surf(void)
Draw all surfaces.
int gs_los_intersect(int, float **, float *)
Crude method of intersecting line of sight with closest part of surface.
void GS_set_exag(int id, float exag)
Set Z exag for surface.
void GS_alldraw_wire(void)
Draw all wires.
void GS_setlight_ambient(int num, float red, float green, float blue)
Set light ambient.
void GS_set_fov(int fov)
Set field of view.
int gs_att_is_set(geosurf *, IFLAG)
Check if attribute is set.
geosurf * gsdiff_get_SDref(void)
ADD.
#define VCOL2DCOL(gs, vcol)
int GS_delete_surface(int id)
Delete surface.
int GS_transp_is_set(void)
Check if transparency is set.
double east
Extent coordinates (east)
int GS_set_drawres(int id, int xres, int yres, int xwire, int ywire)
Set draw resolution for surface.
int GS_v3dir(float *, float *, float *)
Get a normalized direction from v1 to v2, store in v3.
void gsd_pushmatrix(void)
Push the current matrix stack.
const char * G_find_raster2(const char *, const char *)
Find a raster map (look but don't touch)
void gsd_real2surf(geosurf *, Point3)
Convert real to surface coordinates.
void GS_set_cplane(int num)
Set cplace.
GLuint gsd_put_legend(const char *, GLuint, int, int *, float *, int *)
Put legend.
int gsd_surf(geosurf *)
ADD.
void GS_draw_line_onsurf(int id, float x1, float y1, float x2, float y2)
Draw line on surface.
void gsd_model2real(Point3)
Convert model to real coordinates.
void GS_get_modelposition1(float pos[])
Retrieves coordinates for lighting model position, at center of view.
void gsd_deletelist(GLuint, int)
Delete list.
void gsd_display_fringe(geosurf *, unsigned long, float, int[4])
Display fridge.
int GS_get_fencecolor(void)
Get fence color.
void GS_get_to_real(float *to)
Get 'to' real coordinates.
double ew_res
Resolution - east to west cell size for 2D data.
int gsd_wire_surf(geosurf *)
Draw surface wire.
#define VROW2DROW(gs, vrow)
int GS_has_transparency(void)
Check for transparency.
void GS_lights_on(void)
Switch on all lights.
int GS_get_SDsurf(int *id)
Get ?
void GS_setlight_color(int num, float red, float green, float blue)
Set light color.
int gs_init_surf(geosurf *, double, double, int, int, double, double)
Initialize allocated geosurf struct.
int GS_unset_att(int id, int att)
Unset attribute.
geosurf * gs_get_new_surface(void)
Allocate new geosurf struct.
int rows
Number of rows for 2D data.
int GS_get_nozero(int id, int att, int *mode)
Get no-zero ?
void gsd_do_scale(int)
Set current scale.
int GS_get_light_reset(void)
void GS_unset_SDsurf(void)
Unset Scaled Difference surface.
void gsd_cplane_settrans(int, float, float, float)
ADD.
int G_debug(int, const char *,...) __attribute__((format(printf
void gsd_scale(float, float, float)
Multiply the current matrix by a general scaling matrix.
int GS_get_val_at_xy(int id, int att, char *valstr, float x, float y)
Get RGB color at given point.
int gsd_getViewport(GLint *, GLint *)
int gs_set_att_src(geosurf *, int, int)
Set attribute source.
int GS_draw_nline_onsurf(int id, float x1, float y1, float x2, float y2, float *lasp, int n)
Draw multiline on surface.
void gsd_swapbuffers(void)
Swap buffers.
char * gsds_get_name(int)
Get name.
int * GS_get_surf_list(int *numsurfs)
Get surface list.
void GS_v3mult(float *, float)
Multiple vectors.
void GS_done_draw(void)
Draw done, swap buffers.
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...
int gs_calc_normals(geosurf *)
Calculate normals.
void GS_libinit(void)
Initialize OGSF library.
struct lightdefs lights[MAX_LIGHTS]
void gsd_drawsphere(float *, unsigned long, float)
Draw sphere.
#define GET_MAPATT(buff, offset, att)