|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-fc1694ea64
|
Nviz library – Data management. More...
#include <grass/colors.h>#include <grass/raster.h>#include <grass/glocale.h>#include <grass/nviz.h>
Go to the source code of this file.
Functions | |
| void | Nviz_init_data (nv_data *data) |
| Initialize Nviz data. | |
| void | Nviz_destroy_data (nv_data *data) |
| Free allocated space by nv_data struct. | |
| void | Nviz_set_bgcolor (nv_data *data, int color) |
| Set background color. | |
| int | Nviz_get_bgcolor (nv_data *data) |
| Get background color. | |
| int | Nviz_color_from_str (const char *color_str) |
| Get color value from color string (name or RGB triplet) | |
| struct fringe_data * | Nviz_new_fringe (nv_data *data, int id, unsigned long color, double elev, int nw, int ne, int sw, int se) |
| struct fringe_data * | Nviz_set_fringe (nv_data *data, int id, unsigned long color, double elev, int nw, int ne, int sw, int se) |
| void | Nviz_draw_fringe (nv_data *data) |
| int | Nviz_set_arrow (nv_data *data, int sx, int sy, float size, unsigned int color) |
| Sets the North Arrow position and return world coords. | |
| int | Nviz_draw_arrow (nv_data *data) |
| Draws the North Arrow. | |
| void | Nviz_delete_arrow (nv_data *data) |
| Deletes the North Arrow. | |
| struct scalebar_data * | Nviz_new_scalebar (nv_data *data, int bar_id, float *coords, float size, unsigned int color) |
| struct scalebar_data * | Nviz_set_scalebar (nv_data *data, int bar_id, int sx, int sy, float size, unsigned int color) |
| Sets the scale bar position and return world coords. | |
| void | Nviz_draw_scalebar (nv_data *data) |
| Draws the Scale bar. | |
| void | Nviz_delete_scalebar (nv_data *data, int bar_id) |
| Deletes scale bar. | |
Nviz library – Data management.
Based on visualization/nviz/src/
(C) 2008, 2010 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 nviz.c.
Get color value from color string (name or RGB triplet)
| color_str | color string |
Definition at line 125 of file nviz.c.
References _, BLU_MASK, G_str_to_color(), G_warning(), GRN_MASK, and RED_MASK.
Deletes the North Arrow.
| data | nviz data |
Definition at line 315 of file nviz.c.
References nv_data::draw_arrow.
Deletes scale bar.
When scalebar is freed, array then contains NULL, which must be tested during drawing.
| data | nviz data |
Definition at line 435 of file nviz.c.
References G_free(), NULL, and nv_data::scalebar.
Free allocated space by nv_data struct.
| data | nviz data |
Definition at line 68 of file nviz.c.
References nv_data::arrow, nv_data::draw_arrow, nv_data::fringe, G_free(), NULL, nv_data::num_fringes, nv_data::num_scalebars, and nv_data::scalebar.
Draws the North Arrow.
| data | nviz data |
Definition at line 298 of file nviz.c.
References nv_data::arrow, nv_data::draw_arrow, and gsd_north_arrow().
Draw fringe
| data | nviz data |
Definition at line 234 of file nviz.c.
References fringe_data::color, fringe_data::elev, nv_data::fringe, GS_draw_fringe(), fringe_data::id, nv_data::num_fringes, and fringe_data::where.
Draws the Scale bar.
| data | nviz data |
Definition at line 412 of file nviz.c.
References scalebar_data::color, gsd_scalebar_v2(), nv_data::num_scalebars, nv_data::scalebar, scalebar_data::size, and scalebar_data::where.
Get background color.
| data | nviz data |
Definition at line 113 of file nviz.c.
References nv_data::bgcolor.
Initialize Nviz data.
| data | nviz data |
Definition at line 26 of file nviz.c.
References nv_data::arrow, nv_data::cur_cplane, nv_data::draw_arrow, nv_data::fringe, GS_set_light_reset(), MAX_CPLANES, MAX_LIGHTS, NULL, nv_data::num_cplanes, nv_data::num_fringes, nv_data::num_scalebars, Nviz_new_cplane(), Nviz_new_light(), Nviz_off_cplane(), nv_data::scalebar, nv_data::xyrange, and nv_data::zrange.
| struct fringe_data * Nviz_new_fringe | ( | nv_data * | data, |
| int | id, | ||
| unsigned long | color, | ||
| double | elev, | ||
| int | nw, | ||
| int | ne, | ||
| int | sw, | ||
| int | se | ||
| ) |
Add new fringe
| data | nviz data |
| id | surface id |
| color | color |
| elev | fringe elevation |
| nw,ne,sw,se | 1 (turn on) 0 (turn off) |
Definition at line 150 of file nviz.c.
References fringe_data::color, fringe_data::elev, nv_data::fringe, G_free(), G_malloc, G_realloc, GS_get_surf_list(), GS_surf_exists(), fringe_data::id, NULL, nv_data::num_fringes, and fringe_data::where.
Referenced by Nviz_set_fringe().
| struct scalebar_data * Nviz_new_scalebar | ( | nv_data * | data, |
| int | bar_id, | ||
| float * | coords, | ||
| float | size, | ||
| unsigned int | color | ||
| ) |
Add new scalebar
| data | nviz data |
| bar_id | scale bar id |
| coords | real(?) coordinates |
| size | scale bar length |
| color | scalebar/text color |
Definition at line 333 of file nviz.c.
References scalebar_data::color, G_malloc, G_realloc, scalebar_data::id, nv_data::num_scalebars, nv_data::scalebar, scalebar_data::size, and scalebar_data::where.
Referenced by Nviz_set_scalebar().
Sets the North Arrow position and return world coords.
| data | nviz data |
| sx,sy | screen coordinates |
| size | arrow length |
| color | arrow/text color |
Definition at line 253 of file nviz.c.
References nv_data::arrow, arrow_data::color, G_free(), G_malloc, GS_get_surf_list(), GS_num_surfs(), GS_set_Narrow(), fringe_data::id, and arrow_data::size.
Set background color.
| data | nviz data |
| color | color value |
Definition at line 99 of file nviz.c.
References nv_data::bgcolor.
| struct fringe_data * Nviz_set_fringe | ( | nv_data * | data, |
| int | id, | ||
| unsigned long | color, | ||
| double | elev, | ||
| int | nw, | ||
| int | ne, | ||
| int | sw, | ||
| int | se | ||
| ) |
Set fringe
| data | nviz data |
| id | surface id |
| color | color |
| elev | fringe elevation |
| nw,ne,sw,se | 1 (turn on) 0 (turn off) |
Definition at line 194 of file nviz.c.
References fringe_data::color, fringe_data::elev, nv_data::fringe, G_free(), GS_get_surf_list(), GS_surf_exists(), fringe_data::id, NULL, nv_data::num_fringes, Nviz_new_fringe(), and fringe_data::where.
| struct scalebar_data * Nviz_set_scalebar | ( | nv_data * | data, |
| int | bar_id, | ||
| int | sx, | ||
| int | sy, | ||
| float | size, | ||
| unsigned int | color | ||
| ) |
Sets the scale bar position and return world coords.
| data | nviz data |
| bar_id | scale bar id |
| sx,sy | screen coordinates |
| size | scale bar length |
| color | scalebar/text color |
Definition at line 367 of file nviz.c.
References scalebar_data::color, G_free(), GS_get_surf_list(), GS_num_surfs(), GS_set_Narrow(), scalebar_data::id, NULL, nv_data::num_scalebars, Nviz_new_scalebar(), nv_data::scalebar, scalebar_data::size, and scalebar_data::where.