Loading...
Searching...
No Matches
gp.c File Reference

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

`#include <stdlib.h>`
`#include <grass/gis.h>`
`#include <grass/ogsf.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.
geosite * | gp_get_prev_site (int id)
| Get previous geosite struct from list.
int | gp_num_sites (void)
| Get number of loaded point sets.
geosite * | gp_get_last_site (void)
| Get last point set.
geosite * | gp_get_new_site (void)
| Create new geosite instance and add it to list.
void | gp_update_drapesurfs (void)
| Update drape surfaces.
int | gp_set_defaults (geosite *gp)
| Set default value for geosite struct.
int | gp_init_site (geosite *gp)
| Initialize geosite struct.
void | gp_delete_site (int id)
| Delete point set and remove from list.
int | gp_free_site (geosite *fp)
| Free allocated geosite struct.
void | gp_free_sitemem (geosite *fp)
| Free geosite (lower level).
void | gp_set_drapesurfs (geosite *gp, int hsurfs[], int nsurfs)
| Set drape surfaces.

## Detailed Description

OGSF library - loading and manipulating point 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, GMSL/University of Illinois (January 1994)
  Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gp.c.

## Macro Definition Documentation

## FIRST_SITE_ID

#define FIRST_SITE_ID 21720

Definition at line 21 of file gp.c.

Referenced by gp_get_new_site().

## Function Documentation

## gp_delete_site()

void gp_delete_site | ( | int | id | ) |

Delete point set and remove from list.

Parameters

  id | point set id

Definition at line 238 of file gp.c.

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

Referenced by GP_delete_site().

## gp_free_site()

int gp_free_site | ( | geosite * | fp | ) |

Free allocated geosite struct.

Parameters

  fp | pointer to geosite struct

Returns
  1 on success
  -1 on failure

Definition at line 261 of file gp.c.

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

Referenced by gp_delete_site().

## gp_free_sitemem()

void gp_free_sitemem | ( | geosite * | fp | ) |

Free geosite (lower level).

Parameters

  fp | pointer to geosite struct

Definition at line 310 of file gp.c.

References G_free(), and NULL.

Referenced by gp_free_site(), and GP_load_site().

## gp_get_last_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 95 of file gp.c.

References G_debug(), and NULL.

Referenced by gp_get_new_site().

## 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 119 of file gp.c.

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

Referenced by GP_new_site().

## gp_get_prev_site()

geosite * gp_get_prev_site | ( | int | id | ) |

Get previous geosite struct from list.

Parameters

  id | point set id

Returns
  pointer to geosite struct
  NULL on failure

Definition at line 56 of file gp.c.

References G_debug(), and NULL.

## gp_get_site()

geosite * gp_get_site | ( | int | id | ) |

Get geosite struct.

Parameters

  id | point set id

Returns
  pointer to geosite struct
  NULL on failure

Definition at line 33 of file gp.c.

References G_debug(), and NULL.

Referenced by gp_delete_site(), GP_draw_site(), GP_Get_ClientData(), GP_get_sitename(), GP_get_style(), GP_get_trans(), GP_get_zmode(), GP_load_site(), GP_select_surf(), GP_Set_ClientData(), GP_set_style(), GP_set_style_thematic(), GP_set_trans(), GP_set_zmode(), GP_site_exists(), GP_surf_is_selected(), GP_unselect_surf(), GP_unset_style_thematic(), and Nviz_set_vpoint_attr_default().

## gp_init_site()

int gp_init_site | ( | geosite * | gp | ) |

Initialize geosite struct.

Todo
  Currently does nothing

Parameters

  gp | pointer to geosite struct

Returns
  -1 on failure
  0 on success

Definition at line 222 of file gp.c.

References G_debug().

## gp_num_sites()

int gp_num_sites | ( | void |  | ) |

Get number of loaded point sets.

Returns
  number of point sets

Definition at line 76 of file gp.c.

References G_debug().

Referenced by GP_num_sites().

## gp_set_defaults()

int gp_set_defaults | ( | geosite * | gp | ) |

Set default value for geosite struct.

Parameters

  gp | pointer to geosite struct

Returns
  1 on success
  -1 on failure

Definition at line 189 of file gp.c.

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

Referenced by GP_new_site().

## gp_set_drapesurfs()

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

Set drape surfaces.

Parameters

  gp | pointer to geosite struct
  hsurfs | list of surfaces (id)
  nsurfs | number of surfaces

Definition at line 355 of file gp.c.

## gp_update_drapesurfs()

void gp_update_drapesurfs | ( | void |  | ) |

Update drape surfaces.

Call after surface is deleted

Definition at line 157 of file gp.c.

References gs_get_surf(), and NULL.