GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
plus_line.c File Reference

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

#include <sys/types.h>
#include <stdlib.h>
#include <grass/vector.h>
#include <grass/glocale.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, const struct line_pnts *Points, const struct bound_box *box, off_t offset)
 Add new line to Plus_head structure. More...
 
int dig_restore_line (struct Plus_head *plus, int lineid, int type, const struct line_pnts *Points, const struct bound_box *box, off_t offset)
 Restore line in Plus_head structure. More...
 
int dig_del_line (struct Plus_head *plus, int line, double x, double y, double z)
 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...
 

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

◆ dig_add_line()

int dig_add_line ( struct Plus_head plus,
int  type,
const struct line_pnts Points,
const struct bound_box box,
off_t  offset 
)

Add new line to Plus_head structure.

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

Definition at line 136 of file plus_line.c.

References Plus_head::alloc_lines, dig_alloc_lines(), and Plus_head::n_lines.

◆ dig_del_line()

int dig_del_line ( struct Plus_head plus,
int  line,
double  x,
double  y,
double  z 
)

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
[in]x,y,zcoordinates
Returns
-1 on error
0 OK

Definition at line 219 of file plus_line.c.

References G_debug(), Plus_head::Line, P_topo_b::N1, and P_topo_b::N2.

◆ dig_line_get_area()

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 343 of file plus_line.c.

References Plus_head::Line.

Referenced by Vect_build_line_area().

◆ dig_line_set_area()

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 384 of file plus_line.c.

References Plus_head::Line.

◆ dig_restore_line()

int dig_restore_line ( struct Plus_head plus,
int  lineid,
int  type,
const struct line_pnts Points,
const struct bound_box box,
off_t  offset 
)

Restore line in Plus_head structure.

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

Definition at line 192 of file plus_line.c.

References Plus_head::n_lines.