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

Vector library - update topo for nodes (lower level functions) More...

#include <stdlib.h>
#include <math.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Include dependency graph for plus_node.c:

Go to the source code of this file.

Functions

int dig_node_add_line (struct Plus_head *plus, int nodeid, int lineid, struct line_pnts *points, int type)
 Add line info to node. More...
 
int dig_add_node (struct Plus_head *plus, double x, double y, double z)
 Add new node to plus structure. More...
 
int dig_which_node (struct Plus_head *plus, double x, double y, double thresh)
 Return actual index into node arrays of the first set of matching coordinates. More...
 
float dig_node_line_angle (struct Plus_head *plus, int nodeid, int lineid)
 Return line angle. More...
 

Detailed Description

Vector library - update topo for nodes (lower level functions)

Lower level functions for reading/writing/manipulating vectors.

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
CERL (probably Dave Gerdes), Radim Blazek
Date
2001-2006

Definition in file plus_node.c.

Function Documentation

int dig_add_node ( struct Plus_head *  plus,
double  x,
double  y,
double  z 
)

Add new node to plus structure.

Parameters
[in]pluspointer to Plus_head structure
[in]x,y,zcoordinates
Returns
-1 on error
number of node

Definition at line 106 of file plus_node.c.

References dig_alloc_node(), dig_alloc_nodes(), dig_spidx_add_node(), G_debug(), point::x, and y.

int dig_node_add_line ( struct Plus_head *  plus,
int  nodeid,
int  lineid,
struct line_pnts *  points,
int  type 
)

Add line info to node.

Line will be negative if END node

'node' must of course already exist space will be alloced to add 'line' to array

Parameters
[in]pluspointer to Plus_head structure
[in]nodeidnode id
[in]lineidline id
[in]pointsline geometry
[in]typeline type
Returns
-1 on error
0 line not added (degenerate)
new number of lines in node

Definition at line 42 of file plus_node.c.

References dig_calc_begin_angle(), dig_calc_end_angle(), dig_node_alloc_line(), G_debug(), and main::GV_LINES.

float dig_node_line_angle ( struct Plus_head *  plus,
int  nodeid,
int  lineid 
)

Return line angle.

Lines is specified by line id in topology, NOT by order number. Negative id if looking for line end point.

Parameters
[in]pluspointer to Plus_head structure
[in]nodeidnode id
[in]lineidline id
Returns
line angle <-PI,PI>
0 not reached

Definition at line 202 of file plus_node.c.

References G_debug(), and G_fatal_error().

Referenced by dig_build_area_with_line(), and dig_node_angle_check().

int dig_which_node ( struct Plus_head *  plus,
double  x,
double  y,
double  thresh 
)

Return actual index into node arrays of the first set of matching coordinates.

Parameters
[in]pluspointer to Plus_head structure
[in]x,ycoordinates
[in]threshthreshold value
Returns
node index
-1 if no node found

Definition at line 150 of file plus_node.c.

References NULL.