#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/Vect.h>
Go to the source code of this file.
Functions | |
struct line_cats * | Vect__new_cats_struct (void) |
struct line_cats * | Vect_new_cats_struct () |
creates and initializes a struct line_cats. This structure is used for reading and writing vector cats. The library routines handle all memory allocation. | |
int | Vect_destroy_cats_struct (struct line_cats *p) |
frees all memory associated with a struct line_cats, including the struct itself | |
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_cat_get (struct line_cats *Cats, int field, int *cat) |
get first found category of given field 'cat' is set to first category found or -1 if field was not found | |
int | Vect_cat_del (struct line_cats *Cats, int field) |
delete all categories of given field | |
int | Vect_field_cat_del (struct line_cats *Cats, int field, int cat) |
delete field/cat from line_cats structure | |
int | Vect_reset_cats (struct line_cats *Cats) |
reset category structure to make sure cats structure is clean to be re-used. I.e. it has no cats associated with it. Cats must have previously been created with Vect_new_cats_struct() | |
struct cat_list * | Vect_new_cat_list () |
ADD TEXT. | |
int | Vect_destroy_cat_list (struct cat_list *p) |
ADD TEXT. | |
int | Vect_str_to_cat_list (char *str, struct cat_list *list) |
Convert string of categories and cat ranges separated by commas to cat_list. Examples of string: 2,3,5-9,20. str - input string. | |
int | Vect_array_to_cat_list (int *vals, int nvals, struct cat_list *list) |
Convert ordered array of integers to cat_list. | |
int | Vect_cat_in_cat_list (int cat, struct cat_list *list) |
check if category is in list | |
int | Vect_cat_in_array (int cat, int *array, int ncats) |
check if category is in ordered array of integers |
struct line_cats * Vect__new_cats_struct | ( | void | ) | [read] |
int Vect_array_to_cat_list | ( | int * | vals, | |
int | nvals, | |||
struct cat_list * | list | |||
) |
int Vect_cat_del | ( | struct line_cats * | Cats, | |
int | field | |||
) |
int Vect_cat_get | ( | struct line_cats * | Cats, | |
int | field, | |||
int * | cat | |||
) |
get first found category of given field 'cat' is set to first category found or -1 if field was not found
Cats | ||
field | ||
cat | pointer to variable where cat will be written |
Definition at line 146 of file cats.c.
Referenced by Vect_get_line_cat(), Vect_net_build_graph(), and Vect_set_varray_from_cat_list().
int Vect_cat_in_array | ( | int | cat, | |
int * | array, | |||
int | ncats | |||
) |
int Vect_cat_in_cat_list | ( | int | cat, | |
struct cat_list * | list | |||
) |
check if category is in list
category | number, line_cats structure |
Definition at line 433 of file cats.c.
Referenced by Vect_set_varray_from_cat_list().
int Vect_cat_set | ( | struct line_cats * | Cats, | |
int | field, | |||
int | cat | |||
) |
add new field/cat to category structure if doesn't exist yet.
Cats | ||
field | ||
cat |
Definition at line 98 of file cats.c.
References dig_alloc_cats().
Referenced by Vect_clean_small_angles_at_nodes(), Vect_overlay_and(), and Vect_remove_duplicates().
int Vect_destroy_cat_list | ( | struct cat_list * | p | ) |
ADD TEXT.
line_cats | structure |
Definition at line 289 of file cats.c.
Referenced by Vect_set_varray_from_cat_string().
int Vect_destroy_cats_struct | ( | struct line_cats * | p | ) |
frees all memory associated with a struct line_cats, including the struct itself
line_cats | structure |
Definition at line 71 of file cats.c.
Referenced by Vect_copy_map_lines(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_db(), and Vect_snap_lines().
int Vect_field_cat_del | ( | struct line_cats * | Cats, | |
int | field, | |||
int | cat | |||
) |
struct cat_list * Vect_new_cat_list | ( | ) | [read] |
ADD TEXT.
- |
Definition at line 263 of file cats.c.
Referenced by Vect_set_varray_from_cat_string().
struct line_cats * Vect_new_cats_struct | ( | ) | [read] |
creates and initializes a struct line_cats. This structure is used for reading and writing vector cats. The library routines handle all memory allocation.
- |
Definition at line 37 of file cats.c.
References Vect__new_cats_struct().
Referenced by add_area_cats_to_cidx(), delete_area_cats_from_cidx(), remove_bridges(), remove_dangles(), V1_rewrite_line_nat(), V2_delete_line_nat(), Vect_break_lines(), Vect_break_polygons(), Vect_build_nat(), Vect_clean_small_angles_at_nodes(), Vect_copy_map_lines(), Vect_get_area_cat(), Vect_get_line_cat(), Vect_net_build_graph(), Vect_overlay_and(), Vect_remove_duplicates(), Vect_remove_small_areas(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_db(), and Vect_snap_lines().
int Vect_reset_cats | ( | struct line_cats * | Cats | ) |
reset category structure to make sure cats structure is clean to be re-used. I.e. it has no cats associated with it. Cats must have previously been created with Vect_new_cats_struct()
line_cats | structure |
Definition at line 249 of file cats.c.
Referenced by Vect_break_polygons(), Vect_clean_small_angles_at_nodes(), Vect_get_area_cat(), Vect_get_area_cats(), and Vect_overlay_and().
int Vect_str_to_cat_list | ( | char * | str, | |
struct cat_list * | list | |||
) |
Convert string of categories and cat ranges separated by commas to cat_list. Examples of string: 2,3,5-9,20. str - input string.
string,line_cats | structure |
Definition at line 314 of file cats.c.
Referenced by Vect_set_varray_from_cat_string().