GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
gv_quick.c File Reference

OGSF library -. More...

#include <stdio.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/ogsf.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

◆ MFAST_LNS

#define MFAST_LNS   400

max number of lines desired

Definition at line 38 of file gv_quick.c.

Referenced by gv_decimate_lines().

◆ TFAST_PTS

#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

◆ gln_num_points()

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.

References g_line::next, and g_line::npts.

Referenced by gv_num_points().

◆ gv_decimate_lines()

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_vect::fastlines, gv_num_points(), g_vect::lines, MFAST_LNS, g_vect::n_lines, g_line::next, g_line::npts, NULL, and TFAST_PTS.

◆ gv_line_length()

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(), g_line::npts, g_line::p2, and g_line::p3.

◆ gv_num_points()

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(), and g_vect::lines.

Referenced by gv_decimate_lines().