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

OGSF library -. More...

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

Go to the source code of this file.

Macros

#define TFAST_PTS   800
 target number of desired points to represent entire file More...
 
#define MFAST_LNS   400
 max number of lines desired More...
 

Functions

float gv_line_length (geoline *gln)
 Get line width. More...
 
int gln_num_points (geoline *gln)
 Get number of line vertices. More...
 
int gv_num_points (geovect *gv)
 Get number of points in vector. More...
 
int gv_decimate_lines (geovect *gv)
 Decimate line. More...
 

Detailed Description

OGSF library -.

GRASS OpenGL gsurf OGSF Library

Trying some stuff to draw a quick version of a vector map, to represent it when doing interactive translations.

(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.

Author
Bill Brown, USACERL (December 1993)
Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gv_quick.c.

Macro Definition Documentation

#define MFAST_LNS   400

max number of lines desired

Definition at line 38 of file gv_quick.c.

Referenced by gv_decimate_lines().

#define TFAST_PTS   800

target number of desired points to represent entire file

Definition at line 33 of file gv_quick.c.

Referenced by gv_decimate_lines().

Function Documentation

int gln_num_points ( geoline *  gln)

Get number of line vertices.

Parameters
glnline (geoline)
Returns
number of vertices

Definition at line 196 of file gv_quick.c.

Referenced by gv_decimate_lines(), and gv_num_points().

int gv_decimate_lines ( geovect *  gv)

Decimate line.

strategy here: if line has more than average number of points, decimate by eliminating points, otherwise decimate by eliminating shorter lines

Parameters
gvvector (geovect)
Returns

Definition at line 232 of file gv_quick.c.

References G_debug(), gln_num_points(), gv_line_length(), gv_num_points(), MFAST_LNS, NULL, and TFAST_PTS.

Referenced by gvd_vect().

float gv_line_length ( geoline *  gln)

Get line width.

Parameters
glnline (geoline)
Returns
line width

Definition at line 172 of file gv_quick.c.

References GS_distance(), GS_P2distance(), and n.

Referenced by gv_decimate_lines().

int gv_num_points ( geovect *  gv)

Get number of points in vector.

Parameters
gvvector (geovect)
Returns
number of points

Definition at line 215 of file gv_quick.c.

References gln_num_points().

Referenced by gv_decimate_lines().