Loading...
Searching...
No Matches
gsd_prim.c File Reference

OGSF library - primitive drawing functions (lower level functions). More...

`#include <stdlib.h>`
`#include <string.h>`
`#include <grass/config.h>`
`#include <grass/gis.h>`
`#include <grass/ogsf.h>`
`#include <grass/glocale.h>`
Include dependency graph for gsd_prim.c:

Go to the source code of this file.

## Macros

#define | USE_GL_NORMALIZE
#define | RED_MASK 0x000000FF
#define | GRN_MASK 0x0000FF00
#define | BLU_MASK 0x00FF0000
#define | ALP_MASK 0xFF000000
#define | INT_TO_RED(i, r)
#define | INT_TO_GRN(i, g)
#define | INT_TO_BLU(i, b)
#define | INT_TO_ALP(i, a)
#define | MAX_OBJS 64
#define | border 15

## Functions

void | gsd_flush (void)
| Mostly for flushing drawing commands across a network.
void | gsd_colormode (int cm)
| Set color mode.
void | show_colormode (void)
| Print color mode to stderr.
void | gsd_circ (float x, float y, float rad)
| ADD.
void | gsd_disc (float x, float y, float z, float rad)
| ADD.
void | gsd_sphere (float *center, float siz)
| ADD.
void | gsd_zwritemask (unsigned long n)
| Write out z-mask.
void | gsd_backface (int n)
| ADD.
void | gsd_linewidth (short n)
| Set width of rasterized lines.
void | gsd_bgnqstrip (void)
| ADD.
void | gsd_endqstrip (void)
| ADD.
void | gsd_bgntmesh (void)
| ADD.
void | gsd_endtmesh (void)
| ADD.
void | gsd_bgntstrip (void)
| ADD.
void | gsd_endtstrip (void)
| ADD.
void | gsd_bgntfan (void)
| ADD.
void | gsd_endtfan (void)
| ADD.
void | gsd_swaptmesh (void)
| ADD.
void | gsd_bgnpolygon (void)
| Delimit the vertices of a primitive or a group of like primitives.
void | gsd_endpolygon (void)
| Delimit the vertices of a primitive or a group of like primitives.
void | gsd_bgnline (void)
| Begin line.
void | gsd_endline (void)
| End line.
void | gsd_shademodel (int shade)
| Set shaded model.
int | gsd_getshademodel (void)
| Get shaded model.
void | gsd_bothbuffers (void)
| Draw to the front and back buffers.
void | gsd_frontbuffer (void)
| Draw to the front buffer.
void | gsd_backbuffer (void)
| Draw to the back buffer.
void | gsd_swapbuffers (void)
| Swap buffers.
void | gsd_popmatrix (void)
| Pop the current matrix stack.
void | gsd_pushmatrix (void)
| Push the current matrix stack.
void | gsd_scale (float xs, float ys, float zs)
| Multiply the current matrix by a general scaling matrix.
void | gsd_translate (float dx, float dy, float dz)
| Multiply the current matrix by a translation matrix.
void | gsd_getwindow (int *window, int *viewport, double *modelMatrix, double *projMatrix)
| Get viewport.
int | gsd_checkpoint (float pt[4], int window[4], int viewport[4], double modelMatrix[16], double projMatrix[16])
| ADD.
void | gsd_rot (float angle, char axis)
| ADD.
void | gsd_litvert_func (float *norm, unsigned long col, float *pt)
| Set the current normal vector & specify vertex.
void | gsd_litvert_func2 (float *norm, unsigned long col, float *pt)
| ADD.
void | gsd_vert_func (float *pt)
| ADD.
void | gsd_color_func (unsigned int col)
| Set current color.
void | gsd_init_lightmodel (void)
| Initialize model light.
void | gsd_set_material (int set_shin, int set_emis, float sh, float em, int emcolor)
| Set material.
void | gsd_deflight (int num, struct lightdefs *vals)
| Define light.
void | gsd_switchlight (int num, int on)
| Switch light on/off.
int | gsd_getimage (unsigned char **pixbuf, unsigned int *xsize, unsigned int *ysize)
| Get image of current GL screen.
int | gsd_getViewport (GLint tmp[4], GLint num[2])
| Get viewpoint.
int | gsd_writeView (unsigned char **pixbuf, unsigned int xsize, unsigned int ysize)
| Write view.
void | gsd_blend (int yesno)
| Specify pixel arithmetic.
void | gsd_def_clipplane (int num, double *params)
| Define clip plane.
void | gsd_set_clipplane (int num, int able)
| Set clip plane.
void | gsd_finish (void)
| Finish.
void | gsd_viewport (int l, int r, int b, int t)
| Set the viewport.
int | gsd_makelist (void)
| ADD.
void | gsd_bgnlist (int listno, int do_draw)
| ADD.
void | gsd_endlist (void)
| End list.
void | gsd_deletelist (GLuint listno, int range)
| Delete list.
void | gsd_calllist (int listno)
| ADD.
void | gsd_calllists (int listno)
| ADD.

## Detailed Description

OGSF library - primitive drawing functions (lower level functions).

GRASS OpenGL gsurf OGSF Library

(C) 1999-2008, 2018 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
  Bill Brown USACERL (January 1993)
  Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)
  Support for framebuffer objects by Huidae Cho <grass4u gmail.com> (July 2018)

Definition in file gsd_prim.c.

## Macro Definition Documentation

## ALP_MASK

#define ALP_MASK 0xFF000000

Definition at line 51 of file gsd_prim.c.

## BLU_MASK

#define BLU_MASK 0x00FF0000

Definition at line 50 of file gsd_prim.c.

Referenced by Gp_load_sites_thematic(), Gv_load_vect_thematic(), iso_calc_cube(), Nviz_color_from_str(), and slice_calc().

## border

#define border 15

Definition at line 62 of file gsd_prim.c.

Referenced by gsd_getwindow().

## GRN_MASK

#define GRN_MASK 0x0000FF00

Definition at line 49 of file gsd_prim.c.

Referenced by Gp_load_sites_thematic(), Gv_load_vect_thematic(), iso_calc_cube(), Nviz_color_from_str(), and slice_calc().

## INT_TO_ALP

#define INT_TO_ALP | ( |  | i,
|  |  | a )

Value:
(a = (i & ALP_MASK) >> 24)
ALP_MASK
#define ALP_MASK
Definition gsd_prim.c:51

Definition at line 56 of file gsd_prim.c.

Referenced by gsd_color_func().

## INT_TO_BLU

#define INT_TO_BLU | ( |  | i,
|  |  | b )

Value:
(b = (i & BLU_MASK) >> 16)
b
double b
Definition driver/set_window.c:5
BLU_MASK
#define BLU_MASK
Definition gsd_prim.c:50

Definition at line 55 of file gsd_prim.c.

Referenced by GS_get_val_at_xy(), and gsd_color_func().

## INT_TO_GRN

#define INT_TO_GRN | ( |  | i,
|  |  | g )

Value:
(g = (i & GRN_MASK) >> 8)
GRN_MASK
#define GRN_MASK
Definition gsd_prim.c:49
g
float g
Definition named_colr.c:7

Definition at line 54 of file gsd_prim.c.

Referenced by GS_get_val_at_xy(), and gsd_color_func().

## INT_TO_RED

#define INT_TO_RED | ( |  | i,
|  |  | r )

Value:
(r = (i & RED_MASK))
r
double r
Definition driver/set_window.c:5
RED_MASK
#define RED_MASK
Definition gsd_prim.c:48

Definition at line 53 of file gsd_prim.c.

Referenced by GS_get_val_at_xy(), and gsd_color_func().

## MAX_OBJS

#define MAX_OBJS 64

Definition at line 58 of file gsd_prim.c.

Referenced by gsd_calllists(), gsd_deletelist(), and gsd_makelist().

## RED_MASK

#define RED_MASK 0x000000FF

Definition at line 48 of file gsd_prim.c.

Referenced by Gp_load_sites_thematic(), Gv_load_vect_thematic(), iso_calc_cube(), Nviz_color_from_str(), and slice_calc().

## USE_GL_NORMALIZE

#define USE_GL_NORMALIZE

Definition at line 46 of file gsd_prim.c.

## Function Documentation

## gsd_backbuffer()

void gsd_backbuffer | ( | void |  | ) |

Draw to the back buffer.

Definition at line 470 of file gsd_prim.c.

Referenced by GS_set_draw().

## gsd_backface()

void gsd_backface | ( | int | n | ) |

ADD.

Parameters

  n |

Definition at line 254 of file gsd_prim.c.

Referenced by GS_draw_lighting_model(), GS_draw_lighting_model1(), and gsd_3darrow().

## gsd_bgnline()

void gsd_bgnline | ( | void |  | ) |

Begin line.

Definition at line 397 of file gsd_prim.c.

Referenced by gk_draw_path(), gsd_3dcursor(), gsd_arrow(), gsd_diamond_lines(), gsd_draw_box(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_vert_line(), gsd_line_onsurf(), gsd_nline_onsurf(), gsd_plus(), gsd_put_legend(), gsd_scalebar_v2(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsd_x(), gvd_draw_lineonsurf(), gvd_vect(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_bgnlist()

void gsd_bgnlist | ( | int | listno,
|  | int | do_draw )

ADD.

Parameters

  listno |
  do_draw |

Definition at line 1125 of file gsd_prim.c.

Referenced by gsd_3darrow(), and gsd_put_legend().

## gsd_bgnpolygon()

void gsd_bgnpolygon | ( | void |  | ) |

Delimit the vertices of a primitive or a group of like primitives.

Definition at line 372 of file gsd_prim.c.

Referenced by gsd_box(), gsd_cube(), gsd_diamond(), gsd_draw_cplane(), gsd_north_arrow(), gsd_scalebar(), gsd_surf_const(), and gvld_isosurf().

## gsd_bgnqstrip()

void gsd_bgnqstrip | ( | void |  | ) |

ADD.

Definition at line 277 of file gsd_prim.c.

Referenced by gsd_fringe_horiz_poly(), gsd_fringe_vert_poly(), and primitive_cylinder().

## gsd_bgntfan()

void gsd_bgntfan | ( | void |  | ) |

ADD.

Definition at line 337 of file gsd_prim.c.

Referenced by gsd_coarse_surf_map(), gsd_surf_map(), primitive_cone(), and primitive_cylinder().

## gsd_bgntmesh()

void gsd_bgntmesh | ( | void |  | ) |

ADD.

Definition at line 297 of file gsd_prim.c.

Referenced by gsd_diamond(), gsd_ortho_wall(), gsd_surf_const(), gsd_surf_map_old(), gsd_triangulated_wall(), and gvld_slice().

## gsd_bgntstrip()

void gsd_bgntstrip | ( | void |  | ) |

ADD.

Definition at line 317 of file gsd_prim.c.

## gsd_blend()

void gsd_blend | ( | int | yesno | ) |

Specify pixel arithmetic.

Parameters

  yesno | turn on/off

Definition at line 994 of file gsd_prim.c.

Referenced by gsd_coarse_surf_map(), gsd_draw_cplane(), gsd_ortho_wall(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gvld_isosurf(), gvld_slice(), and gvld_slices().

## gsd_bothbuffers()

void gsd_bothbuffers | ( | void |  | ) |

Draw to the front and back buffers.

Definition at line 446 of file gsd_prim.c.

Referenced by GS_set_draw().

## gsd_calllist()

void gsd_calllist | ( | int | listno | ) |

ADD.

Parameters

  listno |

Definition at line 1173 of file gsd_prim.c.

Referenced by GS_draw_list(), and gsd_3darrow().

## gsd_calllists()

void gsd_calllists | ( | int | listno | ) |

ADD.

Parameters

  listno | [unused]

Definition at line 1185 of file gsd_prim.c.

References gsd_call_label(), gsd_popmatrix(), gsd_pushmatrix(), and MAX_OBJS.

Referenced by GS_draw_all_list().

## gsd_checkpoint()

int gsd_checkpoint | ( | float | pt[4],
|  | int | window[4],
|  | int | viewport[4],
|  | double | modelMatrix[16],
|  | double | projMatrix[16] )

ADD.

Parameters

  pt |
  window |
  viewport |
  doubleMatrix |
  projMatrix |

Returns
  0
  1

Definition at line 585 of file gsd_prim.c.

References X, and Y.

Referenced by gpd_2dsite(), gpd_3dsite(), gsd_surf_const(), gsd_surf_map(), and gsd_surf_map_old().

## gsd_circ()

void gsd_circ | ( | float | x,
|  | float | y,
|  | float | rad )

ADD.

Parameters

  x,y |
  rad |

Definition at line 167 of file gsd_prim.c.

References x.

Referenced by gsd_draw_gyro().

## gsd_color_func()

void gsd_color_func | ( | unsigned int | col | ) |

Set current color.

Parameters

  col | color value

Definition at line 698 of file gsd_prim.c.

References b, g, INT_TO_ALP, INT_TO_BLU, INT_TO_GRN, INT_TO_RED, and r.

Referenced by gk_draw_path(), gpd_obj(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), gs_put_label(), gsd_3darrow(), gsd_arrow(), gsd_arrow_onsurf(), gsd_display_fringe(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_gyro(), gsd_drawsphere(), gsd_get_los(), gsd_litvert_func(), gsd_north_arrow(), gsd_plus(), gsd_put_legend(), gsd_scalebar(), gsd_scalebar_v2(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsd_x(), gvd_draw_lineonsurf(), gvd_vect(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_colormode()

void gsd_colormode | ( | int | cm | ) |

Set color mode.

Call glColorMaterial before enabling the GL_COLOR_MATERIAL

Parameters

  cm | color mode value

Definition at line 98 of file gsd_prim.c.

Referenced by gk_draw_path(), gpd_obj(), GS_draw_lighting_model(), GS_draw_lighting_model1(), gsd_bgn_legend_viewport(), gsd_coarse_surf_map(), gsd_display_fringe(), gsd_norm_arrows(), gsd_ortho_wall(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gvd_vect(), gvld_isosurf(), gvld_slices(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_def_clipplane()

void gsd_def_clipplane | ( | int | num,
|  | double * | params )

Define clip plane.

Parameters

  num |
  params |

Definition at line 1014 of file gsd_prim.c.

Referenced by gsd_def_cplane().

## gsd_deflight()

void gsd_deflight | ( | int | num,
|  | struct lightdefs * | vals )

Define light.

Parameters

  num | light id (starts with 1)
  vals | position(x,y,z,w), color, ambientm, emission

Definition at line 836 of file gsd_prim.c.

References X, and Y.

Referenced by GS_new_light(), GS_setlight_ambient(), GS_setlight_color(), and GS_setlight_position().

## gsd_deletelist()

void gsd_deletelist | ( | GLuint | listno,
|  | int | range )

Delete list.

Parameters

  listno |
  range | [unused]

Definition at line 1153 of file gsd_prim.c.

References MAX_OBJS.

Referenced by GS_delete_list().

## gsd_disc()

void gsd_disc | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | rad )

ADD.

Parameters

  x,y,z |
  rad |

Definition at line 187 of file gsd_prim.c.

References x.

Referenced by gsd_arrow_onsurf().

## gsd_endline()

void gsd_endline | ( | void |  | ) |

End line.

Definition at line 407 of file gsd_prim.c.

Referenced by gk_draw_path(), gsd_3dcursor(), gsd_arrow(), gsd_diamond_lines(), gsd_draw_box(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_vert_line(), gsd_line_onsurf(), gsd_nline_onsurf(), gsd_plus(), gsd_put_legend(), gsd_scalebar_v2(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsd_x(), gvd_draw_lineonsurf(), gvd_vect(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_endlist()

void gsd_endlist | ( | void |  | ) |

End list.

Definition at line 1140 of file gsd_prim.c.

Referenced by gsd_3darrow(), and gsd_put_legend().

## gsd_endpolygon()

void gsd_endpolygon | ( | void |  | ) |

Delimit the vertices of a primitive or a group of like primitives.

Definition at line 387 of file gsd_prim.c.

Referenced by gsd_box(), gsd_cube(), gsd_diamond(), gsd_draw_cplane(), gsd_north_arrow(), gsd_scalebar(), gsd_surf_const(), and gvld_isosurf().

## gsd_endqstrip()

void gsd_endqstrip | ( | void |  | ) |

ADD.

Definition at line 287 of file gsd_prim.c.

Referenced by gsd_fringe_horiz_poly(), gsd_fringe_vert_poly(), and primitive_cylinder().

## gsd_endtfan()

void gsd_endtfan | ( | void |  | ) |

ADD.

Definition at line 347 of file gsd_prim.c.

Referenced by gsd_coarse_surf_map(), gsd_surf_map(), primitive_cone(), and primitive_cylinder().

## gsd_endtmesh()

void gsd_endtmesh | ( | void |  | ) |

ADD.

Definition at line 307 of file gsd_prim.c.

Referenced by gsd_diamond(), gsd_ortho_wall(), gsd_surf_const(), gsd_surf_map_old(), gsd_triangulated_wall(), and gvld_slice().

## gsd_endtstrip()

void gsd_endtstrip | ( | void |  | ) |

ADD.

Definition at line 327 of file gsd_prim.c.

## gsd_finish()

void gsd_finish | ( | void |  | ) |

Finish.

Does nothing, only called from src.contrib/GMSL/NVIZ2.2/src/glwrappers.c

Definition at line 1059 of file gsd_prim.c.

## gsd_flush()

void gsd_flush | ( | void |  | ) |

Mostly for flushing drawing commands across a network.

glFlush doesn't block, so if blocking is desired use glFinish.

Definition at line 84 of file gsd_prim.c.

Referenced by GS_clear(), GS_done_draw(), GS_draw_lighting_model(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_north_arrow(), gsd_scalebar(), and gsd_scalebar_v2().

## gsd_frontbuffer()

void gsd_frontbuffer | ( | void |  | ) |

Draw to the front buffer.

Definition at line 458 of file gsd_prim.c.

Referenced by GS_set_draw().

## gsd_getimage()

int gsd_getimage | ( | unsigned char ** | pixbuf,
|  | unsigned int * | xsize,
|  | unsigned int * | ysize )

Get image of current GL screen.

Parameters

  | pixbuf | data buffer
  [out] | xsize,ysize | picture dimension

Returns
  0 on failure
  1 on success

Definition at line 902 of file gsd_prim.c.

References b, l, r, and t.

Referenced by GS_write_ppm(), and GS_write_tif().

## gsd_getshademodel()

int gsd_getshademodel | ( | void |  | ) |

Get shaded model.

Returns
  shade

Definition at line 438 of file gsd_prim.c.

Referenced by gsd_3darrow(), gsd_box(), gsd_cube(), and gsd_diamond().

## gsd_getViewport()

int gsd_getViewport | ( | GLint | tmp[4],
|  | GLint | num[2] )

Get viewpoint.

Parameters

  tmp |
  num |

Returns
  1

Definition at line 950 of file gsd_prim.c.

## gsd_getwindow()

void gsd_getwindow | ( | int * | window,
|  | int * | viewport,
|  | double * | modelMatrix,
|  | double * | projMatrix )

Get viewport.

Parameters

  [out] | window |
  | viewport |
  | modelMatrix | model matrix
  | projMatrix | projection matrix

Definition at line 554 of file gsd_prim.c.

References border, gsd_do_scale(), gsd_popmatrix(), and gsd_pushmatrix().

Referenced by gpd_2dsite(), gpd_3dsite(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gvld_isosurf(), and gvld_slices().

## gsd_init_lightmodel()

void gsd_init_lightmodel | ( | void |  | ) |

Initialize model light.

Definition at line 719 of file gsd_prim.c.

Referenced by GS_new_light().

## gsd_linewidth()

void gsd_linewidth | ( | short | n | ) |

Set width of rasterized lines.

Parameters

  n | line width

Definition at line 267 of file gsd_prim.c.

Referenced by gk_draw_path(), gpd_2dsite(), gpd_3dsite(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), gsd_arrow_onsurf(), gsd_bgn_legend_viewport(), gsd_display_fringe(), gsd_get_los(), gsd_scalebar_v2(), gvd_vect(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_litvert_func()

void gsd_litvert_func | ( | float * | norm,
|  | unsigned long | col,
|  | float * | pt )

Set the current normal vector & specify vertex.

Parameters

  norm | normal vector
  col | color value
  pt | point (model coordinates)

Definition at line 657 of file gsd_prim.c.

References gsd_color_func().

Referenced by gsd_box(), gsd_coarse_surf_map(), gsd_cube(), gsd_diamond(), gsd_ortho_wall(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gvld_isosurf(), and gvld_slice().

## gsd_litvert_func2()

void gsd_litvert_func2 | ( | float * | norm,
|  | unsigned long | col,
|  | float * | pt )

ADD.

Parameters

  norm |
  col | [unused]
  pt |

Definition at line 673 of file gsd_prim.c.

Referenced by primitive_cone(), and primitive_cylinder().

## gsd_makelist()

int gsd_makelist | ( | void |  | ) |

ADD.

First time called, gets a bunch of objects, then hands them back when needed

Returns
  -1 on failure
  number of objects

Definition at line 1094 of file gsd_prim.c.

References MAX_OBJS.

Referenced by gsd_3darrow(), and gsd_put_legend().

## gsd_popmatrix()

void gsd_popmatrix | ( | void |  | ) |

Pop the current matrix stack.

Definition at line 501 of file gsd_prim.c.

Referenced by gpd_2dsite(), gpd_3dsite(), gpd_obj(), GS_draw_lighting_model(), GS_draw_lighting_model1(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), gsd_3darrow(), gsd_arrow(), gsd_bgn_legend_viewport(), gsd_box(), gsd_calllists(), gsd_coarse_surf_map(), gsd_cube(), gsd_diamond(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_gyro(), gsd_end_legend_viewport(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_getwindow(), gsd_norm_arrows(), gsd_north_arrow(), gsd_ortho_wall(), gsd_scalebar(), gsd_scalebar_v2(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gvd_vect(), gvld_isosurf(), gvld_slices(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_pushmatrix()

void gsd_pushmatrix | ( | void |  | ) |

Push the current matrix stack.

Definition at line 511 of file gsd_prim.c.

Referenced by gpd_2dsite(), gpd_3dsite(), gpd_obj(), GS_draw_lighting_model(), GS_draw_lighting_model1(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), GS_set_Narrow(), gsd_3darrow(), gsd_arrow(), gsd_bgn_legend_viewport(), gsd_box(), gsd_calllists(), gsd_coarse_surf_map(), gsd_cube(), gsd_diamond(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_getwindow(), gsd_norm_arrows(), gsd_north_arrow(), gsd_ortho_wall(), gsd_scalebar(), gsd_scalebar_v2(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gvd_vect(), gvld_isosurf(), gvld_slices(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_rot()

void gsd_rot | ( | float | angle,
|  | char | axis )

ADD.

Parameters

  angle |
  axis |

Definition at line 605 of file gsd_prim.c.

References G_warning(), and x.

Referenced by gsd_3darrow(), gsd_arrow(), gsd_draw_asterisk(), gsd_draw_cplane(), and gsd_draw_gyro().

## gsd_scale()

void gsd_scale | ( | float | xs,
|  | float | ys,
|  | float | zs )

Multiply the current matrix by a general scaling matrix.

Parameters

  xs | x scale value
  ys | y scale value
  zs | z scale value

Definition at line 525 of file gsd_prim.c.

Referenced by gpd_obj(), GS_draw_lighting_model1(), gsd_3darrow(), gsd_arrow(), gsd_box(), gsd_cube(), gsd_diamond(), gsd_do_scale(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), and gsd_draw_gyro().

## gsd_set_clipplane()

void gsd_set_clipplane | ( | int | num,
|  | int | able )

Set clip plane.

Parameters

  num |
  able |

Definition at line 1041 of file gsd_prim.c.

Referenced by gsd_cplane_off(), gsd_cplane_on(), gsd_draw_cplane(), and gsd_draw_cplane_fence().

## gsd_set_material()

void gsd_set_material | ( | int | set_shin,
|  | int | set_emis,
|  | float | sh,
|  | float | em,
|  | int | emcolor )

Set material.

Parameters

  set_shin,set_emis | flags
  sh,em | should be 0. - 1.
  emcolor | packed colors to use for emission

Definition at line 803 of file gsd_prim.c.

Referenced by gsd_coarse_surf_map(), gsd_surf_map(), gsd_surf_map_old(), gvld_isosurf(), gvld_slices(), and gvld_wire_slices().

## gsd_shademodel()

void gsd_shademodel | ( | int | shade | ) |

Set shaded model.

Parameters

  shade | non-zero for GL_SMOOTH otherwise GL_FLAT

Definition at line 419 of file gsd_prim.c.

Referenced by GS_draw_lighting_model(), GS_draw_lighting_model1(), GS_draw_surf(), gsd_3darrow(), gsd_box(), gsd_cube(), gsd_diamond(), gvld_isosurf(), gvld_slices(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_sphere()

void gsd_sphere | ( | float * | center,
|  | float | siz )

ADD.

Parameters

  center | center-point
  siz | size value

Definition at line 207 of file gsd_prim.c.

Referenced by gpd_obj(), and gsd_drawsphere().

## gsd_swapbuffers()

void gsd_swapbuffers | ( | void |  | ) |

Swap buffers.

Definition at line 482 of file gsd_prim.c.

Referenced by GS_done_draw().

## gsd_swaptmesh()

void gsd_swaptmesh | ( | void |  | ) |

ADD.

Definition at line 357 of file gsd_prim.c.

Referenced by gsd_diamond().

## gsd_switchlight()

void gsd_switchlight | ( | int | num,
|  | int | on )

Switch light on/off.

Parameters

  num |
  on | 1 for 'on', 0 turns them off

Definition at line 877 of file gsd_prim.c.

Referenced by GS_lights_off(), GS_lights_on(), GS_new_light(), and GS_switchlight().

## gsd_translate()

void gsd_translate | ( | float | dx,
|  | float | dy,
|  | float | dz )

Multiply the current matrix by a translation matrix.

Parameters

  dx | x translation value
  dy | y translation value
  dz | z translation value

Definition at line 539 of file gsd_prim.c.

Referenced by gpd_2dsite(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), gsd_3darrow(), gsd_arrow(), gsd_box(), gsd_coarse_surf_map(), gsd_cube(), gsd_diamond(), gsd_do_scale(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_norm_arrows(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gvd_vect(), gvld_isosurf(), gvld_slices(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_vert_func()

void gsd_vert_func | ( | float * | pt | ) |

ADD.

Parameters

  pt |

Definition at line 686 of file gsd_prim.c.

Referenced by gk_draw_path(), gsd_3dcursor(), gsd_arrow(), gsd_diamond_lines(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_line_onsurf(), gsd_nline_onsurf(), gsd_plus(), gsd_scalebar_v2(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsd_x(), gvd_draw_lineonsurf(), gvd_vect(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_viewport()

void gsd_viewport | ( | int | l,
|  | int | r,
|  | int | b,
|  | int | t )

Set the viewport.

l, b specify the lower left corner of the viewport rectangle, in pixels.

r, t specify the width and height of the viewport.

Parameters

  l | left
  r | right
  b | bottom
  t | top

Definition at line 1077 of file gsd_prim.c.

References b, l, r, and t.

Referenced by GS_set_viewport().

## gsd_writeView()

int gsd_writeView | ( | unsigned char ** | pixbuf,
|  | unsigned int | xsize,
|  | unsigned int | ysize )

Write view.

Parameters

  pixbuf | data buffer
  xsize,ysize | picture dimension

Returns
  0 on failure
  1 on success

Definition at line 969 of file gsd_prim.c.

Referenced by GS_write_zoom().

## gsd_zwritemask()

void gsd_zwritemask | ( | unsigned long | n | ) |

Write out z-mask.

Enable or disable writing into the depth buffer

Parameters

  n | Specifies whether the depth buffer is enabled for writing

Definition at line 241 of file gsd_prim.c.

Referenced by gk_draw_path(), GS_draw_lighting_model(), GS_draw_lighting_model1(), gsd_coarse_surf_map(), gsd_display_fringe(), gsd_draw_cplane(), gsd_ortho_wall(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gvld_isosurf(), gvld_slice(), and gvld_slices().

## show_colormode()

void show_colormode | ( | void |  | ) |

Print color mode to stderr.

Definition at line 151 of file gsd_prim.c.

References G_message().

Referenced by gsd_surf_map_old().