27static int Next_site = 0;
41 G_debug(4,
"GP_site_exists(%d)",
id);
47 for (i = 0; i < Next_site && !
found; i++) {
48 if (Site_ID[i] ==
id) {
114 for (i = 0; i < Next_site; i++) {
136 G_debug(4,
"GP_delete_site(%d)",
id);
141 for (i = 0; i < Next_site && !
found; i++) {
142 if (Site_ID[i] ==
id) {
144 for (
j = i;
j < Next_site;
j++) {
145 Site_ID[
j] = Site_ID[
j + 1];
177 G_debug(3,
"GP_load_site(id=%d, name=%s)",
id, filename);
213 G_debug(4,
"GP_get_sitename(%d)",
id);
236int GP_get_style(
int id,
int *color,
int *width,
float *size,
int *symbol)
240 G_debug(4,
"GP_get_style(%d)",
id);
246 *color =
gp->style->color;
247 *width =
gp->style->width;
248 *symbol =
gp->style->symbol;
249 *size =
gp->style->size;
282 G_debug(4,
"GP_set_style(id=%d, color=%d, width=%d, size=%f, symbol=%d)",
283 id, color, width, size, symbol);
289 gp->style->color = color;
290 gp->style->symbol = symbol;
291 gp->style->size = size;
292 gp->style->width = width;
314 const char *width,
const char *size,
320 "GP_set_style_thematic(id=%d, layer=%d, color=%s, width=%s, "
321 "size=%s, symbol=%s)",
322 id, layer, color, width, size, symbol);
332 gp->tstyle->active = 1;
333 gp->tstyle->layer = layer;
335 gp->tstyle->color_column =
G_store(color);
337 gp->tstyle->symbol_column =
G_store(symbol);
341 gp->tstyle->width_column =
G_store(width);
360 G_debug(4,
"GP_unset_style_thematic(): id=%d",
id);
367 gp->tstyle->active = 0;
388 G_debug(3,
"GP_set_zmode(%d,%d)",
id, use_z);
422 G_debug(4,
"GP_get_zmode(%d)",
id);
501 gp->drape_surf_id[
gp->n_surfs] =
hs;
532 for (i = 0; i <
gp->n_surfs; i++) {
533 if (
gp->drape_surf_id[i] ==
hs) {
534 for (
j = i;
j <
gp->n_surfs - 1;
j++) {
535 gp->drape_surf_id[
j] =
gp->drape_surf_id[
j + 1];
566 for (i = 0; i <
gp->n_surfs; i++) {
567 if (
hs ==
gp->drape_surf_id[i]) {
593 if (
gp->use_z &&
gp->has_z) {
597 for (i = 0; i <
gp->n_surfs; i++) {
602 G_debug(5,
"Drawing site %d on Surf %d",
id,
603 gp->drape_surf_id[i]);
619 for (
id = 0;
id < Next_site;
id++) {
663 return (
gp->clientdata);
692 if (
strcmp(str,
"x") == 0)
694 else if (
strcmp(str,
"box") == 0)
696 else if (
strcmp(str,
"sphere") == 0)
698 else if (
strcmp(str,
"cube") == 0)
700 else if (
strcmp(str,
"diamond") == 0)
702 else if (
strcmp(str,
"dec_tree") == 0)
704 else if (
strcmp(str,
"con_tree") == 0)
706 else if (
strcmp(str,
"aster") == 0)
708 else if (
strcmp(str,
"gyro") == 0)
710 else if (
strcmp(str,
"histogram") == 0)
713 G_warning(
_(
"Unknown icon marker, using \"sphere\""));
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_warning(const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.
int G_debug(int, const char *,...) __attribute__((format(printf
int GS_get_region(float *, float *, float *, float *)
Get 2D region extent.
int gpd_3dsite(geosite *, float, float, int)
Draw 3D point set.
geosurf * gs_get_surf(int)
Get geosurf struct.
int gp_set_defaults(geosite *)
Set default value for geosite struct.
geopoint * Gp_load_sites(const char *, int *, int *)
Load to points to memory.
void gp_free_sitemem(geosite *)
Free geosite (lower level)
geosite * gp_get_new_site(void)
Create new geosite instance and add it to list.
int gpd_2dsite(geosite *, geosurf *, int)
Draw 2D point set.
int gp_num_sites(void)
Get number of loaded point sets.
void gp_delete_site(int)
Delete point set and remove from list.
geosite * gp_get_site(int)
Get geosite struct.
int Gp_load_sites_thematic(geosite *, struct Colors *)
Load styles for geopoints based on thematic mapping.
int GP_select_surf(int hp, int hs)
Select surface for given point set.
int GP_delete_site(int id)
Delete registered point set.
int GP_new_site(void)
Create new point set.
void GP_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
Get transformation params.
int GP_get_zmode(int id, int *use_z)
Get z-mode.
int GP_get_sitename(int id, char **filename)
Get point set filename.
int GP_set_zmode(int id, int use_z)
Set z mode for point set.
int GP_load_site(int id, const char *filename)
Load point set from file.
void GP_set_trans(int id, float xtrans, float ytrans, float ztrans)
Set transformation params.
int GP_Set_ClientData(int id, void *clientd)
Set client data.
int GP_site_exists(int id)
Check if point set exists.
int GP_str_to_marker(const char *str)
Determine point marker symbol for string.
int GP_get_style(int id, int *color, int *width, float *size, int *symbol)
Get point set style.
int GP_surf_is_selected(int hp, int hs)
Check if surface is selected.
int * GP_get_site_list(int *numsites)
Get list of point sets.
int GP_num_sites(void)
Get number of loaded point sets.
void GP_draw_site(int id)
Draw point set.
void * GP_Get_ClientData(int id)
Get client data.
void GP_alldraw_site(void)
Draw all available point sets.
int GP_unselect_surf(int hp, int hs)
Unselect surface.
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_set_style(int id, int color, int width, float size, int symbol)
Set point style.
int GP_unset_style_thematic(int id)
Make style for thematic mapping inactive.
OGSF header file (structures)
Struct for vector map (thematic mapping)