15 #include <grass/glocale.h>
16 #include <grass/vedit.h>
31 int layer,
int del,
struct cat_list *Clist)
34 struct line_cats *Cats;
35 struct line_pnts *Points;
37 int nlines_modified, rewrite;
40 if (Clist->n_ranges <= 0) {
50 for (i = 0; i < List->n_values; i++) {
51 line = List->value[i];
58 for (j = 0; j < Clist->n_ranges; j++) {
59 for (cat = Clist->min[j]; cat <= Clist->
max[j]; cat++) {
63 G_warning(_(
"Unable to set category %d for (feature id %d)"),
93 return nlines_modified;
int Vedit_modify_cats(struct Map_info *Map, struct ilist *List, int layer, int del, struct cat_list *Clist)
Add / remove categories.
int Vect_field_cat_del(struct line_cats *Cats, int field, int cat)
Delete field/cat from line_cats structure.
struct line_pnts * Vect_new_line_struct()
Creates and initializes a struct line_pnts.
int Vect_cat_set(struct line_cats *Cats, int field, int cat)
Add new field/cat to category structure if doesn't exist yet.
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.
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
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.