GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gp.c File Reference

OGSF library - loading and manipulating point sets. More...

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/gstypes.h>
Include dependency graph for gp.c:

Go to the source code of this file.

Macros

#define FIRST_SITE_ID   21720
 

Functions

geosite * gp_get_site (int id)
 Get geosite struct. More...
 
geosite * gp_get_prev_site (int id)
 Get previous geosite struct from list. More...
 
int gp_num_sites (void)
 Get number of loaded point sets. More...
 
geosite * gp_get_last_site (void)
 Get last point set. More...
 
geosite * gp_get_new_site (void)
 Create new geosite instance and add it to list. More...
 
void gp_update_drapesurfs (void)
 Update drape surfaces. More...
 
int gp_set_defaults (geosite *gp)
 Set default value for geosite struct. More...
 
void print_site_fields (geosite *gp)
 Print point set fields, debugging. More...
 
int gp_init_site (geosite *gp)
 Initialize geosite struct. More...
 
void gp_delete_site (int id)
 Delete point set and remove from list. More...
 
int gp_free_site (geosite *fp)
 Free geosite struct. More...
 
void gp_free_sitemem (geosite *fp)
 Free geosite. More...
 
void gp_set_drapesurfs (geosite *gp, int hsurfs[], int nsurfs)
 Set drape surfaces. More...
 

Detailed Description

OGSF library - loading and manipulating point sets.

GRASS OpenGL gsurf OGSF Library

(C) 1999-2008 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, GMSL/University of Illinois (January 1994)
Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gp.c.

Macro Definition Documentation

#define FIRST_SITE_ID   21720

Definition at line 24 of file gp.c.

Referenced by gp_get_new_site().

Function Documentation

void gp_delete_site ( int  id)

Delete point set and remove from list.

Parameters
idpoint set id

Definition at line 266 of file gp.c.

References G_debug(), gp_free_site(), and gp_get_site().

Referenced by GP_delete_site().

int gp_free_site ( geosite *  fp)

Free geosite struct.

Parameters
fppointer to geosite struct
Returns
1 on success
-1 on failure

Definition at line 289 of file gp.c.

References G_debug(), G_free(), gp_free_sitemem(), and NULL.

Referenced by gp_delete_site().

void gp_free_sitemem ( geosite *  fp)

Free geosite.

Parameters
fppointer to geosite struct

Definition at line 338 of file gp.c.

References G_free(), and NULL.

Referenced by gp_free_site(), and GP_load_site().

geosite* gp_get_last_site ( void  )

Get last point set.

Returns
pointer to geosite struct
NULL if no point set is available

Definition at line 97 of file gp.c.

References G_debug(), and NULL.

Referenced by gp_get_new_site().

geosite* gp_get_new_site ( void  )

Create new geosite instance and add it to list.

Returns
pointer to geosite struct
NULL on error

Definition at line 120 of file gp.c.

References FIRST_SITE_ID, G_debug(), gp_get_last_site(), and NULL.

Referenced by GP_new_site().

geosite* gp_get_prev_site ( int  id)

Get previous geosite struct from list.

Parameters
idpoint set id
Returns
pointer to geosite struct
NULL on failure

Definition at line 59 of file gp.c.

References G_debug(), and NULL.

int gp_init_site ( geosite *  gp)

Initialize geosite struct.

Parameters
gppointer to geosite struct
Returns
-1 on failure
0 on success

Definition at line 250 of file gp.c.

References G_debug().

int gp_num_sites ( void  )

Get number of loaded point sets.

Returns
number of point sets

Definition at line 79 of file gp.c.

References G_debug().

Referenced by GP_num_sites().

int gp_set_defaults ( geosite *  gp)

Set default value for geosite struct.

Parameters
gppointer to geosite struct
Returns
1 on success
-1 on failure

Definition at line 183 of file gp.c.

References G_debug(), GS_get_longdim(), and NULL.

Referenced by GP_new_site().

void gp_set_drapesurfs ( geosite *  gp,
int  hsurfs[],
int  nsurfs 
)

Set drape surfaces.

Parameters
gppointer to geosite struct
hsurflist of surfaces (id)
nsurfnumber of surfaces

Definition at line 369 of file gp.c.

void gp_update_drapesurfs ( void  )

Update drape surfaces.

Call after surface is deleted

Definition at line 151 of file gp.c.

References gs_get_surf(), and NULL.

void print_site_fields ( geosite *  gp)

Print point set fields, debugging.

Parameters
gppointer to geosite struct

Definition at line 219 of file gp.c.

Referenced by GP_draw_site().