15 #include <grass/glocale.h>
16 #include <grass/nviz.h>
33 if (width < 1 || height < 1) {
39 G_debug(1,
"Nviz_resize_window(): width = %d height = %d", width, height);
60 float zmin, zmax, exag;
69 dc->zrange = dc->xyrange / exag;
77 zmax = zmin + (3. * dc->xyrange / exag);
78 zmin = zmin - (2. * dc->xyrange / exag);
80 if ((zmax - zmin) > dc->zrange)
81 dc->zrange = zmax - zmin;
96 float xpos, ypos, from[3];
100 xpos = (xpos < 0) ? 0 : (xpos > 1.0) ? 1.0 : xpos;
102 ypos = (ypos < 0) ? 0 : (ypos > 1.0) ? 1.0 : ypos;
104 if (x_pos < 0.0 || x_pos > 1.0 || y_pos < 0.0 || y_pos > 1.0) {
105 G_debug(3,
"Invalid view position coordinates, using %f,%f",
109 G_debug(1,
"Nviz_set_viewpoint_position(): x = %f y = %f", x_pos, y_pos);
112 tempx = xpos * RANGE - RANGE_OFFSET;
113 tempy = ypos * RANGE - RANGE_OFFSET;
115 if ((from[
X] != tempx) || (from[
Y] != tempy)) {
140 G_debug(1,
"Nviz_set_viewpoint_height(): value = %f", height);
144 if (height != from[Z]) {
172 G_debug(1,
"Nviz_set_viewpoint_persp(): value = %d", persp);
174 fov = (int)(10 * persp);
192 G_debug(1,
"Nviz_set_viewpoint_twist(): value = %d", twist);
212 G_debug(1,
"Nviz_change_exag(): value = %f", exag);