GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gvd.c File Reference

OGSF library - loading and manipulating vector sets (lower level functions) More...

#include <stdio.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/gstypes.h>
#include "rowcol.h"
Include dependency graph for gvd.c:

Go to the source code of this file.


#define CHK_FREQ   5


int gs_clip_segment (geosurf *gs, float *bgn, float *end, float *region)
 Clip segment. More...
int gvd_vect (geovect *gv, geosurf *gs, int do_fast)
 Draw vector set. More...
void gvd_draw_lineonsurf (geosurf *gs, float *bgn, float *end, int color)
 Draw line on surface. More...

Detailed Description

OGSF library - loading and manipulating vector sets (lower level functions)

GRASS OpenGL gsurf OGSF Library

(C) 1999-2008 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.

Bill Brown USACERL (December 1993)
Doxygenized by Martin Landa (June 2008)

Definition in file gvd.c.

Macro Definition Documentation

#define CHK_FREQ   5

Definition at line 27 of file gvd.c.

Referenced by gvd_vect().

Function Documentation

int gs_clip_segment ( geosurf *  gs,
float *  bgn,
float *  end,
float *  region 

Clip segment.

to use fast clipping and move to gs.c
bgnbegin point
endend point
regionregion settings
1 segment inside region
0 segment outside region

Definition at line 43 of file gvd.c.

References VCOL2X, VCOLS, VROW2Y, VROWS, X, and Y.

Referenced by gvd_vect().

void gvd_draw_lineonsurf ( geosurf *  gs,
float *  bgn,
float *  end,
int  color 

Draw line on surface.

bgnfirst line point
endend line point
colorcolor value

Definition at line 280 of file gvd.c.

References gs_point_is_masked(), gsd_bgnline(), gsd_color_func(), gsd_endline(), gsd_vert_func(), and gsdrape_get_segments().

int gvd_vect ( geovect *  gv,
geosurf *  gs,
int  do_fast 

Draw vector set.

Need to think about translations - If user translates surface, vector should automatically go with it, but translating vector should translate it relative to surface on which it's displayed?

Handling mask checking here, but may be more appropriate to handle in get_drape_segments?

gvvector set
do_fastnon-zero for fast mode

Definition at line 83 of file gvd.c.

References CHK_FREQ, free(), G_debug(), G_free(), GS_check_cancel(), gs_clip_segment(), gs_get_att_src(), GS_get_scale(), gs_get_zrange(), gs_point_is_masked(), gs_update_curmask(), gsd_bgnline(), gsd_color_func(), gsd_colormode(), gsd_do_scale(), gsd_endline(), gsd_linewidth(), gsd_popmatrix(), gsd_pushmatrix(), gsd_translate(), gsd_vert_func(), gsdrape_get_segments(), gv_decimate_lines(), malloc(), NULL, X, and Y.

Referenced by GV_draw_fastvect(), and GV_draw_vect().