15 #include <grass/colors.h>
16 #include <grass/raster.h>
17 #include <grass/glocale.h>
18 #include <grass/nviz.h>
128 G_warning(
_(
"Invalid color (%s), using \"white\" as default"),
130 red = grn = blu = 255;
149 int id,
unsigned long color,
150 double elev,
int nw,
int ne,
int sw,
int se)
193 int id,
unsigned long color,
194 double elev,
int nw,
int ne,
int sw,
int se)
225 elev, nw, ne, sw, se);
252 int sx,
int sy,
float size,
256 int *surf_list, num_surfs;
281 arw->
where[0] = coords[0];
282 arw->
where[1] = coords[1];
283 arw->
where[2] = coords[2];
335 int bar_id,
float *coords,
float size,
345 s->
where[0] = coords[0];
346 s->
where[1] = coords[1];
347 s->
where[2] = coords[2];
369 int sx,
int sy,
float size,
373 int *surf_list, num_surfs;
390 if (s->
id == bar_id) {
393 s->
where[0] = coords[0];
394 s->
where[1] = coords[1];
395 s->
where[2] = coords[2];
438 if (bar_id < data->num_scalebars && data->
scalebar[bar_id] !=
NULL) {
void G_free(void *buf)
Free allocated memory.
int Nviz_color_from_str(const char *color_str)
Get color value from color string (name or RGB triplet)
struct fringe_data ** fringe
void Nviz_delete_arrow(nv_data *data)
Deletes the North Arrow.
void GS_set_Narrow(int *pt, int id, float *pos2)
Set decoration, north arrow ??
int gsd_north_arrow(float *pos2, float len, GLuint fontbase, unsigned long arw_clr, unsigned long text_clr)
Draw North Arrow takes OpenGL coords and size.
int GS_surf_exists(int id)
void Nviz_init_data(nv_data *data)
Initialize Nviz data.
int Nviz_get_bgcolor(nv_data *data)
Get background color.
void GS_set_light_reset(int i)
int Nviz_off_cplane(nv_data *data, int id)
Turn off (make inactive) the given clip plane.
void Nviz_draw_scalebar(nv_data *data)
Draws the Scale bar.
int GS_num_surfs(void)
Get number of surfaces.
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 scalebar_data * Nviz_new_scalebar(nv_data *data, int bar_id, float *coords, float size, unsigned int color)
void GS_draw_fringe(int id, unsigned long clr, float elev, int *where)
Draw fringe around data (surface) at selected corners.
struct arrow_data * arrow
void Nviz_destroy_data(nv_data *data)
Free allocated space by nv_data struct.
int Nviz_draw_arrow(nv_data *data)
Draws the North Arrow.
int Nviz_new_cplane(nv_data *data, int id)
Creates a clip plane object.
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_set_bgcolor(nv_data *data, int color)
Set background color.
int G_str_to_color(const char *str, int *red, int *grn, int *blu)
Parse color string and set red,green,blue.
int
Reads the categories file for map name in mapset and stores the categories in the pcats structure...
int gsd_scalebar_v2(float *pos, float len, GLuint fontbase, unsigned long bar_clr, unsigned long text_clr)
Draw Scalebar (as lines)
void Nviz_draw_fringe(nv_data *data)
void Nviz_delete_scalebar(nv_data *data, int bar_id)
Deletes scale bar.
int Nviz_new_light(nv_data *data)
Define new light.
struct scalebar_data ** scalebar
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 G_warning(const char *msg,...)
Print a warning message to stderr.
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 * GS_get_surf_list(int *numsurfs)
Get surface list.