GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
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. More... | |
int | GP_new_site (void) |
Create new point set. More... | |
int | GP_num_sites (void) |
Get number of loaded point sets. More... | |
int * | GP_get_site_list (int *numsites) |
Get list of point sets. More... | |
int | GP_delete_site (int id) |
Delete registrated point set. More... | |
int | GP_load_site (int id, const char *filename) |
Load point set from file. More... | |
int | GP_get_sitename (int id, char **filename) |
Get point set filename. More... | |
int | GP_get_style (int id, int *color, int *width, float *size, int *symbol) |
Get point set style. More... | |
int | GP_set_style (int id, int color, int width, float size, int symbol) |
Set point style. More... | |
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. More... | |
int | GP_unset_style_thematic (int id) |
Make style for thematic mapping inactive. More... | |
int | GP_set_zmode (int id, int use_z) |
Set z mode for point set. More... | |
int | GP_get_zmode (int id, int *use_z) |
Get z-mode. More... | |
void | GP_set_trans (int id, float xtrans, float ytrans, float ztrans) |
Set transformation params. More... | |
void | GP_get_trans (int id, float *xtrans, float *ytrans, float *ztrans) |
Get transformation params. More... | |
int | GP_select_surf (int hp, int hs) |
Select surface for given point set. More... | |
int | GP_unselect_surf (int hp, int hs) |
Unselect surface. More... | |
int | GP_surf_is_selected (int hp, int hs) |
Check if surface is selected. More... | |
void | GP_draw_site (int id) |
Draw point set. More... | |
void | GP_alldraw_site (void) |
Draw all available point sets. More... | |
int | GP_Set_ClientData (int id, void *clientd) |
Set client data. More... | |
void * | GP_Get_ClientData (int id) |
Get client data. More... | |
int | GP_str_to_marker (const char *str) |
Determine point marker symbol for string. More... | |
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.
int GP_delete_site | ( | int | id | ) |
Delete registrated point set.
id | point set id |
Definition at line 131 of file gp2.c.
References G_debug(), gp_delete_site(), and GP_site_exists().
void GP_draw_site | ( | int | id | ) |
Draw point set.
id | point set id |
Definition at line 573 of file gp2.c.
References g_site::drape_surf_id, G_debug(), gp_get_site(), gpd_2dsite(), gpd_3dsite(), GS_get_region(), gs_get_surf(), g_site::has_z, g_site::n_surfs, and g_site::use_z.
Referenced by Nviz_draw_all_site().
void* GP_Get_ClientData | ( | int | id | ) |
Get client data.
id | point set id |
Definition at line 649 of file gp2.c.
References g_site::clientdata, 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 101 of file gp2.c.
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 | ||
) |
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 453 of file gp2.c.
References G_debug(), gp_get_site(), g_site::x_trans, g_site::y_trans, and g_site::z_trans.
int GP_get_zmode | ( | int | id, |
int * | use_z | ||
) |
Get z-mode.
id | point set id | |
[out] | use_z | non-zero code to use z |
Definition at line 410 of file gp2.c.
References G_debug(), gp_get_site(), NULL, and g_site::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 |
int GP_new_site | ( | void | ) |
int GP_num_sites | ( | void | ) |
Get number of loaded point sets.
Definition at line 86 of file gp2.c.
References gp_num_sites().
int GP_select_surf | ( | int | hp, |
int | hs | ||
) |
Select surface for given point set.
hp | point set id |
hs | surface id |
Definition at line 480 of file gp2.c.
References g_site::drape_surf_id, G_debug(), gp_get_site(), GP_surf_is_selected(), GS_surf_exists(), and g_site::n_surfs.
int GP_Set_ClientData | ( | int | id, |
void * | clientd | ||
) |
Set client data.
id | point set id |
clientd | client data |
Definition at line 627 of file gp2.c.
References g_site::clientdata, and 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 |
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 |
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 430 of file gp2.c.
References G_debug(), gp_get_site(), g_site::x_trans, g_site::y_trans, and g_site::z_trans.
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 376 of file gp2.c.
References G_debug(), gp_get_site(), g_site::has_z, NULL, and g_site::use_z.
int GP_site_exists | ( | int | id | ) |
Check if point set exists.
id | point set id |
Definition at line 36 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 680 of file gp2.c.
References _, G_warning(), ST_ASTER, ST_BOX, ST_CON_TREE, ST_CUBE, ST_DEC_TREE, ST_DIAMOND, ST_GYRO, ST_HISTOGRAM, ST_SPHERE, and ST_X.
int GP_surf_is_selected | ( | int | hp, |
int | hs | ||
) |
Check if surface is selected.
hp | point set id |
hs | surface id |
Definition at line 548 of file gp2.c.
References g_site::drape_surf_id, G_debug(), gp_get_site(), and g_site::n_surfs.
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 510 of file gp2.c.
References g_site::drape_surf_id, G_debug(), gp_get_site(), GP_surf_is_selected(), and g_site::n_surfs.
int GP_unset_style_thematic | ( | int | id | ) |
Make style for thematic mapping inactive.
id | point set id |
Definition at line 348 of file gp2.c.
References g_vect_style_thematic::active, G_debug(), gp_get_site(), NULL, and g_site::tstyle.