22 #include <grass/gis.h>
23 #include <grass/gstypes.h>
27 static int Vect_ID[MAX_VECTS];
28 static int Next_vect = 0;
48 for (i = 0; i < Next_vect && !found; i++) {
49 if (Vect_ID[i] ==
id) {
67 if (Next_vect < MAX_VECTS) {
70 Vect_ID[Next_vect] = nv->gvect_id;
73 G_debug(3,
"GV_new_vector(): id=%d", nv->gvect_id);
75 return (nv->gvect_id);
105 *numvects = Next_vect;
108 ret = (
int *)G_malloc(Next_vect *
sizeof(
int));
113 for (i = 0; i < Next_vect; i++) {
140 for (i = 0; i < Next_vect && !found; i++) {
141 if (Vect_ID[i] ==
id) {
144 for (j = i; j < Next_vect; j++) {
145 Vect_ID[j] = Vect_ID[j + 1];
186 gv->filename =
G_store(filename);
188 if ((gv->lines =
Gv_load_vect(filename, &(gv->n_lines)))) {
214 *filename =
G_store(gv->filename);
270 *flat = gv->flat_val;
290 gv->x_trans = xtrans;
291 gv->y_trans = ytrans;
292 gv->z_trans = ztrans;
311 *xtrans = gv->x_trans;
312 *ytrans = gv->y_trans;
313 *ztrans = gv->z_trans;
342 gv->drape_surf_id[gv->n_surfs] = hs;
372 for (i = 0; i < gv->n_surfs; i++) {
373 if (gv->drape_surf_id[i] == hs) {
374 for (j = i; j < gv->n_surfs - 1; j++) {
375 gv->drape_surf_id[j] = gv->drape_surf_id[j + 1];
405 for (i = 0; i < gv->n_surfs; i++) {
406 if (hs == gv->drape_surf_id[i]) {
429 for (i = 0; i < gv->n_surfs; i++) {
448 for (
id = 0;
id < Next_vect;
id++) {
469 for (i = 0; i < gv->n_surfs; i++) {
496 gv->clientdata = clientd;
519 return (gv->clientdata);
int * GV_get_vect_list(int *numvects)
Get list of vector sets.
int GV_load_vector(int id, const char *filename)
Load vector set.
void gv_delete_vect(int id)
Delete vector set (unload)
char * G_store(const char *s)
Copy string to allocated memory.
geoline * Gv_load_vect(const char *grassname, int *nlines)
Load vector map to memory.
int GV_get_vectmode(int id, int *mem, int *color, int *width, int *flat)
Get vector set mode.
int GS_surf_exists(int id)
int GV_vect_exists(int id)
Check if vector set exists.
void * GV_Get_ClientData(int id)
Get client data.
int GV_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
Get trans ?
int gvd_vect(geovect *gv, geosurf *gs, int do_fast)
Draw vector set.
void GV_alldraw_vect(void)
Draw all vector sets.
void GV_draw_fastvect(int vid)
Draw vector sets.
int GV_surf_is_selected(int hv, int hs)
Check if surface is selected.
int GV_delete_vector(int id)
Delete vector set from list.
int gv_set_defaults(geovect *gv)
Set attributes of vector set to default values.
int GV_get_vectname(int id, char **filename)
Get vector map name.
int GV_unselect_surf(int hv, int hs)
Unselect surface.
int GV_num_vects(void)
Get number of available vector sets.
int GV_Set_ClientData(int id, void *clientd)
Set client data.
geosurf * gs_get_surf(int id)
Get geosurf struct.
geovect * gv_get_vect(int id)
Get vector set.
void GV_draw_vect(int vid)
Draw vector set.
int G_debug(int level, const char *msg,...)
Print debugging message.
int GV_new_vector(void)
Register new vector set.
geovect * gv_get_new_vect(void)
Allocate memory for new vector set.
int gv_num_vects(void)
Get number of loaded vector sets.
void gv_free_vectmem(geovect *fv)
Free allocated memory.
int GV_select_surf(int hv, int hs)
Select surface identified by hs to have vector identified by hv draped over it.
void GV_set_trans(int id, float xtrans, float ytrans, float ztrans)
Set trans ?
int GV_set_vectmode(int id, int mem, int color, int width, int flat)
Set vector set mode.