grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

extend.c File Reference

Vedit library - extend lines (adopted from break.c) More...

#include <math.h>
#include <grass/vedit.h>
Include dependency graph for extend.c:

Go to the source code of this file.

Macros

#define TOL   1e-9
 

Functions

static int extend_lines (struct Map_info *, int, int, int, int, double, struct ilist *)
 
static int find_extended_intersection (double, double, double, double, double, double, double *, double *)
 
static int check_extended_direction (double, double, double, int, double, double)
 
int Vedit_extend_lines (struct Map_info *Map, struct ilist *List, int nodes, int parallel, double thresh)
 Extend lines in given threshold. More...
 

Detailed Description

Vedit library - extend lines (adopted from break.c)

(C) 2017 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
Huidae Cho <grass4u gmail.com>

Definition in file extend.c.

Macro Definition Documentation

◆ TOL

#define TOL   1e-9

Definition at line 17 of file extend.c.

Function Documentation

◆ check_extended_direction()

static int check_extended_direction ( double  x,
double  y,
double  angle,
int  start_node,
double  extx,
double  exty 
)
static

Definition at line 384 of file extend.c.

References M_PI, tmp, TOL, and x.

Referenced by extend_lines().

◆ extend_lines()

◆ find_extended_intersection()

static int find_extended_intersection ( double  x1,
double  y1,
double  angle1,
double  x2,
double  y2,
double  angle2,
double *  x,
double *  y 
)
static

Definition at line 345 of file extend.c.

References a, d, TOL, x, x1, and x2.

Referenced by extend_lines().

◆ Vedit_extend_lines()

int Vedit_extend_lines ( struct Map_info Map,
struct ilist List,
int  nodes,
int  parallel,
double  thresh 
)

Extend lines in given threshold.

1. Extend first line only
\ \
id1 \ -> \
\
id2 ---------- -----+----
2. Extend both lines
\ \
id1 \ -> \
\
id2 --- +----
3. Extend first line when both are on the same line
id1 --- --- id2 -> -----+----
4. Connect two parallel lines (parallel=1)
id1 ------ -------
-> /
id2 ------ +-----
5. Don't connect two parallel lines (parallel=0)
id1 ------ ------
->
id2 ------ ------
static int first
Definition: gsd_label.c:27
static void line(double m[2][3], double x0, double y0, double x1, double y1)
Definition: icon.c:20
double t
Definition: r_raster.c:39
static int same(const unsigned char *x, const unsigned char *y, int n)
Definition: put_row.c:282
Parameters
Mappointer to Map_info
Listlist of selected lines
nodes1 for start node, 2 for end node, other for both
parallelconnect parallel lines
threshthreshold value
Returns
number of modified lines

Definition at line 68 of file extend.c.

References extend_lines(), G_debug(), GV_LINES, GV_POINTS, line(), ilist::n_values, ilist::value, Vect_destroy_list(), Vect_find_line_list(), Vect_get_line_nodes(), Vect_get_line_type(), Vect_get_node_coor(), Vect_line_alive(), Vect_list_append(), Vect_new_list(), Vect_reset_list(), WITHOUT_Z, and x.