GRASS Programmer's Manual  6.4.2(2012)
Vlib/snap.c File Reference
#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Include dependency graph for Vlib/snap.c:

Go to the source code of this file.

Data Structures

struct  XPNT
struct  NEW

Functions

int add_item (int id, struct ilist *list)
void Vect_snap_lines_list (struct Map_info *Map, struct ilist *List_lines, double thresh, struct Map_info *Err)
 Snap selected lines to existing vertex in threshold.
void Vect_snap_lines (struct Map_info *Map, int type, double thresh, struct Map_info *Err)
 Snap lines in vector map to existing vertex in threshold.

Function Documentation

int add_item ( int  id,
struct ilist *  list 
)

Definition at line 44 of file Vlib/snap.c.

References dig_list_add().

Referenced by Vect_snap_lines_list().

void Vect_snap_lines ( struct Map_info *  Map,
int  type,
double  thresh,
struct Map_info *  Err 
)

Snap lines in vector map to existing vertex in threshold.

For details see Vect_snap_lines_list()

Parameters:
[in]Mapinput map where vertices will be snapped
[in]typetype of lines to snap
[in]threshthreshold in which snap vertices
[out]Errvector map where lines representing snap are written or NULL
Returns:
void

Definition at line 442 of file Vlib/snap.c.

References dig_list_add(), G_debug(), NULL, Vect_destroy_list(), Vect_get_num_lines(), Vect_line_alive(), Vect_new_list(), Vect_read_line(), and Vect_snap_lines_list().

void Vect_snap_lines_list ( struct Map_info *  Map,
struct ilist *  List_lines,
double  thresh,
struct Map_info *  Err 
)

Snap selected lines to existing vertex in threshold.

Snap selected lines to existing vertices.

Warning:
Lines are not necessarily snapped to nearest vertex, but to vertex in threshold!

Lines showing how vertices were snapped may be optionally written to error map. Input map must be opened on level 2 for update at least on GV_BUILD_BASE.

Parameters:
[in]Mapinput map where vertices will be snapped
[in]List_lineslist of lines to snap
[in]threshthreshold in which snap vertices
[out]Errvector map where lines representing snap are written or NULL
Returns:
void

Definition at line 80 of file Vlib/snap.c.

References add_item(), NEW::along, XPNT::anchor, NEW::anchor, Rect::boundary, dig_distance2_point_to_line(), G_debug(), G_free(), G_percent(), gui_modules::vdigit::GV_LINES, NULL, RTreeDestroyNode(), RTreeInsertRect(), RTreeNewIndex(), RTreeSearch(), Vect_append_point(), Vect_delete_line(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_line_prune(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_read_line(), Vect_reset_line(), Vect_reset_list(), Vect_rewrite_line(), Vect_write_line(), XPNT::x, and XPNT::y.

Referenced by gui_modules.wxvdigit.IVDigit::SnapLine(), and Vect_snap_lines().

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines