GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72735
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gv.c File Reference

OGSF library - loading and manipulating vector sets (lower level functions) More...

#include <stdio.h>
#include <stdlib.h>
#include <grass/ogsf.h>
#include "gsget.h"
Include dependency graph for gv.c:

Go to the source code of this file.

Macros

#define FIRST_VECT_ID   20656
 

Functions

geovectgv_get_vect (int id)
 Get vector set. More...
 
geovectgv_get_prev_vect (int id)
 Get previous vector set. More...
 
int gv_num_vects (void)
 Get number of loaded vector sets. More...
 
geovectgv_get_last_vect (void)
 Get last loaded vector set. More...
 
geovectgv_get_new_vect (void)
 Allocate memory for new vector set. More...
 
void gv_update_drapesurfs (void)
 Update drape surfaces. More...
 
int gv_set_defaults (geovect *gv)
 Set attributes of vector set to default values. More...
 
int gv_init_vect (geovect *gv)
 Initialize geovect struct. More...
 
void gv_delete_vect (int id)
 Delete vector set (unload) More...
 
int gv_free_vect (geovect *fv)
 Free allocated memory for geovect struct. More...
 
void gv_free_vectmem (geovect *fv)
 Free allocated memory. More...
 
void gv_set_drapesurfs (geovect *gv, int *hsurfs, int nsurfs)
 Set drape surfaces for vector set. More...
 

Detailed Description

OGSF library - loading and manipulating vector sets (lower level functions)

(C) 1999-2008, 2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Bill Brown USACERL (November 1993)
Doxygenized by Martin Landa (June 2008)

Definition in file gv.c.

Macro Definition Documentation

#define FIRST_VECT_ID   20656

Definition at line 21 of file gv.c.

Referenced by gv_get_new_vect().

Function Documentation

void gv_delete_vect ( int  id)

Delete vector set (unload)

Parameters
idvector set id

Definition at line 239 of file gv.c.

References G_debug(), gv_free_vect(), and gv_get_vect().

Referenced by GV_delete_vector().

int gv_free_vect ( geovect fv)

Free allocated memory for geovect struct.

Parameters
fvpointer to geovect struct
Returns
-1 on failure
1 on success

Definition at line 262 of file gv.c.

References G_debug(), G_free(), gv_free_vectmem(), g_vect::gvect_id, g_vect::next, and NULL.

Referenced by gv_delete_vect().

geovect* gv_get_last_vect ( void  )

Get last loaded vector set.

Returns
pointer to geovect struct
NULL on failure (no vector set available)

Definition at line 94 of file gv.c.

References G_debug(), g_vect::gvect_id, g_vect::next, and NULL.

Referenced by gv_get_new_vect().

geovect* gv_get_new_vect ( void  )

Allocate memory for new vector set.

Returns
pointer to geovect struct
NULL on failure

Definition at line 115 of file gv.c.

References FIRST_VECT_ID, G_debug(), G_zero(), gv_get_last_vect(), g_vect::gvect_id, g_vect::hstyle, g_vect::next, NULL, and g_vect::style.

Referenced by GV_new_vector().

geovect* gv_get_prev_vect ( int  id)

Get previous vector set.

Parameters
idvector set id
Returns
pointer to geovect struct
NULL on failure

Definition at line 56 of file gv.c.

References G_debug(), g_vect::gvect_id, g_vect::next, and NULL.

int gv_init_vect ( geovect gv)

Initialize geovect struct.

Parameters
gvpointer to geovect struct
Returns
-1 on failure
0 on succcess

Definition at line 223 of file gv.c.

References G_debug(), and g_vect::gvect_id.

int gv_num_vects ( void  )

Get number of loaded vector sets.

Returns
number of vector sets

Definition at line 76 of file gv.c.

References G_debug(), and g_vect::next.

Referenced by GV_num_vects().

int gv_set_defaults ( geovect gv)
void gv_set_drapesurfs ( geovect gv,
int hsurfs,
int  nsurfs 
)

Set drape surfaces for vector set.

Parameters
gvpointer to geovect struct
hsurfsarray of surfaces (id)
nsurfsnumber of surfaces

Definition at line 361 of file gv.c.

References g_vect::drape_surf_id, and MAX_SURFS.

void gv_update_drapesurfs ( void  )

Update drape surfaces.

Call after surface is deleted

Definition at line 154 of file gv.c.

References g_vect::drape_surf_id, gs_get_surf(), g_vect::n_surfs, g_vect::next, and NULL.

Referenced by GS_delete_surface().