15 #include <grass/dbmi.h>
16 #include <grass/vedit.h>
33 double x1,
double y1,
double x2,
double y2,
34 double start,
double step)
37 int line,
type, temp_line;
41 struct line_cats *Cats;
42 struct line_pnts *Points, *Points_se;
45 struct line_pnts **Points_a, **Points_b;
46 int nlines_a, nlines_b;
59 cv.ctype = DB_C_TYPE_DOUBLE;
73 for (i = 0; i < List->n_values; i++) {
74 line = List->value[i];
81 if (!(type & GV_LINE))
86 &Points_a, &Points_b, &nlines_a, &nlines_b,
89 if (nlines_a < 2 || nlines_b < 1)
93 for (p_i = 0; p_i < Points_a[0]->n_points; p_i++) {
94 Points_a[0]->z[p_i] = 0;
98 cv.value[cv_i].cat = line;
99 cv.value[cv_i++].val.d = dist;
108 for (cv_i = 0; cv_i < cv.n_values; cv_i++) {
109 line = cv.value[cv_i].cat;
112 for (p_i = 0; p_i < Points->n_points; p_i++) {
113 Points->z[p_i] =
value;
133 return nlines_modified;
struct line_pnts * Vect_new_line_struct()
Creates and initializes a struct line_pnts.
int Vect_line_check_intersection(struct line_pnts *APoints, struct line_pnts *BPoints, int with_z)
Check if 2 lines intersect.
void db_CatValArray_free(dbCatValArray *arr)
int db_CatValArray_alloc(dbCatValArray *arr, int n)
int Vedit_bulk_labeling(struct Map_info *Map, struct ilist *List, double x1, double y1, double x2, double y2, double start, double step)
Lines z-bulk labeling.
int Vect_append_point(struct line_pnts *Points, double x, double y, double z)
Appends one point to the end of a line.
int Vect_rewrite_line(struct Map_info *Map, int line, int type, struct line_pnts *points, struct line_cats *cats)
Rewrites feature info at the given offset.
int Vect_destroy_cats_struct(struct line_cats *p)
Frees all memory associated with line_cats structure, including the struct itself.
int Vect_line_alive(struct Map_info *Map, int line)
Check if feature is alive or dead.
struct line_cats * Vect_new_cats_struct()
Creates and initializes line_cats structure.
double Vect_line_length(struct line_pnts *Points)
Calculate line length, 3D-length in case of 3D vector line.
int db_CatValArray_sort_by_value(dbCatValArray *arr)
Sort key/value array by value.
int Vect_line_intersection(struct line_pnts *APoints, struct line_pnts *BPoints, struct line_pnts ***ALines, struct line_pnts ***BLines, int *nalines, int *nblines, int with_z)
Intersect 2 lines.
int Vect_delete_line(struct Map_info *Map, int line)
Delete feature.
long Vect_write_line(struct Map_info *Map, int type, struct line_pnts *points, struct line_cats *cats)
Writes new feature to the end of file (table)
int Vect_destroy_line_struct(struct line_pnts *p)
Frees all memory associated with a struct line_pnts, including the struct itself. ...
int Vect_read_line(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line)
Read vector feature.