GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
|
OGSF library - loading and manipulating point sets (higher level functions) More...
#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/ogsf.h>
#include <grass/glocale.h>
#include "gsget.h"
Go to the source code of this file.
Functions | |
int | GP_site_exists (int id) |
Check if point set exists. | |
int | GP_new_site (void) |
Create new point set. | |
int | GP_num_sites (void) |
Get number of loaded point sets. | |
int * | GP_get_site_list (int *numsites) |
Get list of point sets. | |
int | GP_delete_site (int id) |
Delete registrated point set. | |
int | GP_load_site (int id, const char *filename) |
Load point set from file. | |
int | GP_get_sitename (int id, char **filename) |
Get point set filename. | |
int | GP_get_style (int id, int *color, int *width, float *size, int *symbol) |
Get point set style. | |
int | GP_set_style (int id, int color, int width, float size, int symbol) |
Set point style. | |
int | GP_set_style_thematic (int id, int layer, const char *color, const char *width, const char *size, const char *symbol, struct Colors *color_rules) |
Set point set style for thematic mapping. | |
int | GP_unset_style_thematic (int id) |
Make style for thematic mapping inactive. | |
int | GP_set_zmode (int id, int use_z) |
Set z mode for point set. | |
int | GP_get_zmode (int id, int *use_z) |
Get z-mode. | |
void | GP_set_trans (int id, float xtrans, float ytrans, float ztrans) |
Set transformation params. | |
void | GP_get_trans (int id, float *xtrans, float *ytrans, float *ztrans) |
Get transformation params. | |
int | GP_select_surf (int hp, int hs) |
Select surface for given point set. | |
int | GP_unselect_surf (int hp, int hs) |
Unselect surface. | |
int | GP_surf_is_selected (int hp, int hs) |
Check if surface is selected. | |
void | GP_draw_site (int id) |
Draw point set. | |
void | GP_alldraw_site (void) |
Draw all available point sets. | |
int | GP_Set_ClientData (int id, void *clientd) |
Set client data. | |
void * | GP_Get_ClientData (int id) |
Get client data. | |
int | GP_str_to_marker (const char *str) |
Determine point marker symbol for string. | |
OGSF library - loading and manipulating point sets (higher 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.
Definition in file gp2.c.
void GP_alldraw_site | ( | void | ) |
Draw all available point sets.
Definition at line 611 of file gp2.c.
References GP_draw_site().
Referenced by gk_follow_frames(), GK_show_site(), and Nviz_draw_quick().
int GP_delete_site | ( | int | id | ) |
Delete registrated point set.
id | point set id |
Definition at line 132 of file gp2.c.
References G_debug(), gp_delete_site(), and GP_site_exists().
Referenced by Nviz_new_map_obj().
void GP_draw_site | ( | int | id | ) |
Draw point set.
id | point set id |
Definition at line 577 of file gp2.c.
References G_debug(), gp_get_site(), gpd_2dsite(), gpd_3dsite(), GS_get_region(), and gs_get_surf().
Referenced by GP_alldraw_site(), and Nviz_draw_all_site().
void * GP_Get_ClientData | ( | int | id | ) |
Get client data.
id | point set id |
Definition at line 653 of file gp2.c.
References gp_get_site(), and NULL.
int * GP_get_site_list | ( | int * | numsites | ) |
Get list of point sets.
Must freed when no longer needed!
numsites | number of point sets |
Definition at line 102 of file gp2.c.
References NULL.
Referenced by Nviz_draw_all_site().
int GP_get_sitename | ( | int | id, |
char ** | filename | ||
) |
int GP_get_style | ( | int | id, |
int * | color, | ||
int * | width, | ||
float * | size, | ||
int * | symbol | ||
) |
Get point set style.
id | point set id |
Definition at line 232 of file gp2.c.
References G_debug(), gp_get_site(), and NULL.
void GP_get_trans | ( | int | id, |
float * | xtrans, | ||
float * | ytrans, | ||
float * | ztrans | ||
) |
Get transformation params.
id | point set id | |
[out] | xtrans,ytrans,ztrans | x/y/z values |
Definition at line 457 of file gp2.c.
References G_debug(), and gp_get_site().
int GP_get_zmode | ( | int | id, |
int * | use_z | ||
) |
int GP_load_site | ( | int | id, |
const char * | filename | ||
) |
Load point set from file.
Check to see if handle already loaded, if so - free before loading new for now, always load to memory.
id | point set id |
filename | point set filename |
Definition at line 173 of file gp2.c.
References G_debug(), G_store(), gp_free_sitemem(), gp_get_site(), Gp_load_sites(), and NULL.
Referenced by Nviz_new_map_obj().
int GP_new_site | ( | void | ) |
Create new point set.
Definition at line 64 of file gp2.c.
References G_debug(), gp_get_new_site(), and gp_set_defaults().
Referenced by Nviz_new_map_obj().
int GP_num_sites | ( | void | ) |
Get number of loaded point sets.
Definition at line 87 of file gp2.c.
References gp_num_sites().
Referenced by Nviz_new_map_obj().
int GP_select_surf | ( | int | hp, |
int | hs | ||
) |
Select surface for given point set.
hp | point set id |
hs | surface id |
Definition at line 484 of file gp2.c.
References G_debug(), gp_get_site(), GP_surf_is_selected(), and GS_surf_exists().
Referenced by Nviz_new_map_obj().
int GP_Set_ClientData | ( | int | id, |
void * | clientd | ||
) |
Set client data.
id | point set id |
clientd | client data |
Definition at line 631 of file gp2.c.
References gp_get_site().
int GP_set_style | ( | int | id, |
int | color, | ||
int | width, | ||
float | size, | ||
int | symbol | ||
) |
Set point style.
Supported icon symbols (markers):
id | point set id |
color | icon color |
width | icon line width |
size | icon size |
symbol | icon symbol |
Definition at line 274 of file gp2.c.
References G_debug(), gp_get_site(), and NULL.
Referenced by Nviz_new_map_obj().
int GP_set_style_thematic | ( | int | id, |
int | layer, | ||
const char * | color, | ||
const char * | width, | ||
const char * | size, | ||
const char * | symbol, | ||
struct Colors * | color_rules | ||
) |
Set point set style for thematic mapping.
Updates also style for each geopoint.
id | point set id |
layer | layer number for thematic mapping (-1 for undefined) |
color | icon color column name |
width | icon line width column name |
size | icon size column name |
symbol | icon symbol column name |
colors | pointer to Colors structure or NULL |
Definition at line 309 of file gp2.c.
References G_debug(), G_store(), G_zero(), gp_get_site(), Gp_load_sites_thematic(), and NULL.
void GP_set_trans | ( | int | id, |
float | xtrans, | ||
float | ytrans, | ||
float | ztrans | ||
) |
Set transformation params.
id | point set id |
xtrans,ytrans,ztrans | x/y/z values |
Definition at line 434 of file gp2.c.
References G_debug(), and gp_get_site().
int GP_set_zmode | ( | int | id, |
int | use_z | ||
) |
Set z mode for point set.
id | point set id |
use_z | TRUE to use z-coordinaces when vector map is 3D |
Definition at line 380 of file gp2.c.
References G_debug(), gp_get_site(), and NULL.
int GP_site_exists | ( | int | id | ) |
Check if point set exists.
id | point set id |
Definition at line 37 of file gp2.c.
References G_debug(), gp_get_site(), and NULL.
Referenced by GP_delete_site().
int GP_str_to_marker | ( | const char * | str | ) |
Determine point marker symbol for string.
Supported markers:
str | string buffer |
Definition at line 684 of file gp2.c.
References G_warning().
Referenced by Gp_load_sites_thematic().
int GP_surf_is_selected | ( | int | hp, |
int | hs | ||
) |
Check if surface is selected.
hp | point set id |
hs | surface id |
Definition at line 552 of file gp2.c.
References G_debug(), and gp_get_site().
Referenced by GP_select_surf(), and GP_unselect_surf().
int GP_unselect_surf | ( | int | hp, |
int | hs | ||
) |
Unselect surface.
hp | point set id |
hs | surface id |
Definition at line 514 of file gp2.c.
References G_debug(), gp_get_site(), and GP_surf_is_selected().
int GP_unset_style_thematic | ( | int | id | ) |
Make style for thematic mapping inactive.
id | point set id |
Definition at line 352 of file gp2.c.
References G_debug(), gp_get_site(), and NULL.