21 #include <grass/glocale.h>
22 #include <grass/nviz.h>
47 int num_surfs, *surf_list;
57 if (type == MAP_OBJ_SURF) {
72 MAP_ATT, name, -1.0, data)) {
79 CONST_ATT,
NULL, value,
86 else if (type == MAP_OBJ_VECT) {
88 G_warning(_(
"Maximum vector line maps loaded!"));
97 G_warning(_(
"Error loading vector map <%s>"), name);
107 for (i = 0; i < num_surfs; i++) {
114 else if (type == MAP_OBJ_SITE) {
116 G_warning(_(
"Maximum vector point maps loaded!"));
128 G_warning(_(
"Error loading vector map <%s>"), name);
135 for (i = 0; i < num_surfs; i++) {
141 else if (type == MAP_OBJ_VOL) {
152 G_warning(_(
"Error loading 3d raster map <%s>"), name);
160 G_warning(_(
"Nviz_new_map_obj(): unsupported data type"));
181 const char *str_value,
double num_value, nv_data *
data)
187 case (MAP_OBJ_SURF):{
192 if (src == CONST_ATT) {
197 value = (double)atof(str_value);
205 if (desc == ATT_COLOR) {
220 else if (src == MAP_ATT) {
229 if (desc == ATT_TOPO) {
238 max = (rows >
cols) ? rows : cols;
246 max = max2 + max2 / 2;
276 float defs[MAX_ATTS];
279 defs[ATT_COLOR] = DEFAULT_SURF_COLOR;
281 defs[ATT_TRANSP] = 0;
282 defs[ATT_SHINE] = 60;
308 for (i = 0; i < GPT_MAX_ATTR; i++)
309 gp->use_attr[i] = ST_ATT_NONE;
324 int rows,
cols, depths;
328 max = (rows >
cols) ? rows : cols;
329 max = (depths >
max) ? depths : max;
364 if (type == MAP_OBJ_SURF) {
int GV_load_vector(int id, const char *filename)
Load vector set.
void G_free(void *buf)
Free allocated memory.
int GS_unset_att(int id, int att)
Unset attribute.
int GVL_delete_vol(int id)
Delete volume set from list.
int GVL_new_vol(void)
Create new volume set.
void GVL_get_dims(int id, int *rows, int *cols, int *depths)
Get volume dimensions.
int GS_new_surface(void)
Add new surface.
int GVL_num_vols(void)
Get number of loaded volume sets.
int Nviz_update_ranges(nv_data *dc)
Update ranges.
int Nviz_set_attr(int id, int type, int desc, int src, const char *str_value, double num_value, nv_data *data)
void GS_set_att_defaults(float *defs, float *null_defs)
Set default attributes for map objects.
int GS_set_drawmode(int id, int mode)
Set draw mode.
int Nviz_set_volume_attr_default(int id)
Set default volume attributes.
int GP_set_sitemode(int id, int atmod, int color, int width, float size, int marker)
Set point set mode.
geosite * gp_get_site(int id)
Get geosite struct.
int GVL_load_vol(int id, const char *filename)
Load 3d raster map to volume set.
int GVL_isosurf_set_drawmode(int id, int mode)
Set isosurface draw mode.
int GP_new_site(void)
Create new point set.
int GV_delete_vector(int id)
Delete vector set from list.
int GVL_slice_set_drawmode(int id, int mode)
Set slice draw mode.
int GS_set_att_const(int id, int att, float constant)
Set attribute constant.
int Nviz_unset_attr(int id, int type, int desc)
int GS_set_drawres(int id, int xres, int yres, int xwire, int ywire)
Set draw resolution for surface.
void GS_get_dims(int id, int *rows, int *cols)
Get dimension of surface.
int Nviz_set_vpoint_attr_default(int id)
Set default vector point attributes.
int GV_num_vects(void)
Get number of available vector sets.
int GS_num_surfs(void)
Get number of surfaces.
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
void Nviz_set_surface_attr_default()
Set default surface attributes.
int GP_delete_site(int id)
Delete registrated point set.
int GV_new_vector(void)
Register new vector set.
int * GS_get_surf_list(int *numsurfs)
Get surface list.
int Nviz_new_map_obj(int type, const char *name, double value, nv_data *data)
Create a new map object which can be one of surf, vect, vol or site.
int GVL_isosurf_set_drawres(int id, int xres, int yres, int zres)
Set isosurface draw resolution.
int GP_num_sites(void)
Get number of loaded point sets.
int GS_load_att_map(int id, const char *filename, int att)
Load raster map as attribute.
int GP_select_surf(int hp, int hs)
Select surface.
int GV_select_surf(int hv, int hs)
Select surface identified by hs to have vector identified by hv draped over it.
int GP_load_site(int id, const char *filename)
Load point set from file.
int GVL_slice_set_drawres(int id, int xres, int yres, int zres)
Set slice draw resolution.
int GV_set_vectmode(int id, int mem, int color, int width, int flat)
Set vector set mode.