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

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

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

Go to the source code of this file.

Functions

int dig_add_line (struct Plus_head *plus, int type, struct line_pnts *Points, long offset)
 Add new line to Plus_head structure. More...
 
int dig_restore_line (struct Plus_head *plus, int lineid, int type, struct line_pnts *Points, long offset)
 Restore line in Plus_head structure. More...
 
int dig_del_line (struct Plus_head *plus, int line)
 Delete line from Plus_head structure. More...
 
plus_t dig_line_get_area (struct Plus_head *plus, plus_t line, int side)
 Get area number on line side. More...
 
int dig_line_set_area (struct Plus_head *plus, plus_t line, int side, plus_t area)
 Set area number on line side. More...
 
int dig_line_set_box (struct Plus_head *plus, plus_t line, BOUND_BOX *Box)
 Set line bounding box. More...
 
int dig_line_get_box (struct Plus_head *plus, plus_t line, BOUND_BOX *Box)
 Get line bounding box saved in topo. More...
 

Detailed Description

Vector library - update topo for lines (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-2008

Definition in file plus_line.c.

Function Documentation

int dig_add_line ( struct Plus_head *  plus,
int  type,
struct line_pnts *  Points,
long  offset 
)

Add new line to Plus_head structure.

Parameters
[in,out]pluspointer to Plus_head structure
[in]typefeature type
[in]Pointsline geometry
[in]offsetline offset
Returns
-1 on error
line id

Definition at line 102 of file plus_line.c.

References dig_alloc_lines().

Referenced by V2_write_line_nat(), and Vect_build_nat().

int dig_del_line ( struct Plus_head *  plus,
int  line 
)

Delete line from Plus_head structure.

Doesn't update area/isle references (dig_del_area() or dig_del_isle()) must be run before the line is deleted if the line is part of such structure). Update is info about line in nodes. If this line is last in node then node is deleted.

Parameters
[in,out]pluspointer to Plus_head structure
[in]lineline id
Returns
-1 on error
0 OK

Definition at line 183 of file plus_line.c.

References dig_node_add_updated(), dig_spidx_del_line(), dig_spidx_del_node(), G_debug(), and NULL.

Referenced by V2_delete_line_nat().

plus_t dig_line_get_area ( struct Plus_head *  plus,
plus_t  line,
int  side 
)

Get area number on line side.

Parameters
[in]pluspointer Plus_head structure
[in]lineline id
[in]sideside id (GV_LEFT || GV_RIGHT)
Returns
area number
0 no area
-1 on error

Definition at line 261 of file plus_line.c.

References G_debug().

Referenced by Vect_build_line_area().

int dig_line_get_box ( struct Plus_head *  plus,
plus_t  line,
BOUND_BOX *  Box 
)

Get line bounding box saved in topo.

Parameters
[in]pluspointer Plus_head structure
[in]lineline id
[in,out]Boxbounding box
Returns
1

Definition at line 343 of file plus_line.c.

Referenced by dig_add_area(), and dig_add_isle().

int dig_line_set_area ( struct Plus_head *  plus,
plus_t  line,
int  side,
plus_t  area 
)

Set area number on line side.

Parameters
[in]pluspointer Plus_head structure
[in]lineline id
[in]sideside id (GV_LEFT || GV_RIGHT)
[in]areaarea id
Returns
1

Definition at line 294 of file plus_line.c.

int dig_line_set_box ( struct Plus_head *  plus,
plus_t  line,
BOUND_BOX *  Box 
)

Set line bounding box.

Parameters
[in]pluspointer Plus_head structure
[in]lineline id
[in]Boxbounding box
Returns
1

Definition at line 318 of file plus_line.c.

Referenced by V2_restore_line_nat(), and V2_write_line_nat().

int dig_restore_line ( struct Plus_head *  plus,
int  lineid,
int  type,
struct line_pnts *  Points,
long  offset 
)

Restore line in Plus_head structure.

Parameters
[in,out]pluspointer to Plus_head structure
[in]typefeature type
[in]Pointsline geometry
[in]offsetline offset
Returns
-1 on error
line id

Definition at line 157 of file plus_line.c.

Referenced by V2_restore_line_nat().