GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Nviz library – Change view settings. More...
#include <math.h>
#include <grass/glocale.h>
#include <grass/nviz.h>
Go to the source code of this file.
Functions | |
int | Nviz_resize_window (int width, int height) |
GL canvas resized. More... | |
int | Nviz_update_ranges (nv_data *dc) |
Update ranges. More... | |
int | Nviz_set_viewpoint_position (double x_pos, double y_pos) |
Change position of view. More... | |
void | Nviz_get_viewpoint_position (double *x_pos, double *y_pos) |
int | Nviz_set_viewpoint_height (double height) |
Change viewpoint height. More... | |
void | Nviz_get_viewpoint_height (double *height) |
int | Nviz_set_viewpoint_persp (int persp) |
Change viewpoint perspective (field of view) More... | |
int | Nviz_set_viewpoint_twist (int twist) |
Change viewpoint twist. More... | |
int | Nviz_change_exag (nv_data *data, double exag) |
Change z-exag value. More... | |
int | Nviz_look_here (double sx, double sy) |
Change focused point. More... | |
void | Nviz_get_modelview (double *modelMatrix) |
Get current modelview matrix. More... | |
void | Nviz_set_rotation (double angle, double x, double y, double z) |
Set rotation parameters. More... | |
void | Nviz_unset_rotation (void) |
Stop scene rotation. More... | |
void | Nviz_init_rotation (void) |
Stop scene rotation. More... | |
void | Nviz_flythrough (nv_data *data, float *fly_info, int *scale, int lateral) |
Fly through the scene. More... | |
Nviz library – Change view settings.
Based on visualization/nviz/src/change_view.c
(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 change_view.c.
int Nviz_change_exag | ( | nv_data * | data, |
double | exag | ||
) |
Change z-exag value.
data | nviz data |
exag | exag value |
Definition at line 239 of file change_view.c.
References G_debug(), GS_global_exag(), GS_set_global_exag(), and Nviz_update_ranges().
Referenced by wxnviz.Nviz::SetViewDefault(), and wxnviz.Nviz::SetZExag().
Fly through the scene.
Computes parameters needed for moving scene. Changes viewpoint and viewdir. Based on visualization/nviz/src/togl_flythrough.c and simplified.
fly_info | values computed from mouse movement |
scale | rate of movement |
lateral | type of movement |
Definition at line 322 of file change_view.c.
References GS_get_from(), GS_get_viewdir(), GS_moveto(), GS_set_viewdir(), dialogs::h, X, and Y.
Referenced by wxnviz.Nviz::FlyThrough().
void Nviz_get_modelview | ( | double * | modelMatrix | ) |
Get current modelview matrix.
Definition at line 272 of file change_view.c.
Referenced by wxnviz.Nviz::GetRotationParameters().
void Nviz_get_viewpoint_height | ( | double * | height | ) |
Definition at line 181 of file change_view.c.
References G_debug(), and GS_get_from_real().
Referenced by wxnviz.Nviz::GetViewpointPosition().
void Nviz_get_viewpoint_position | ( | double * | x_pos, |
double * | y_pos | ||
) |
Definition at line 130 of file change_view.c.
References G_debug(), GS_get_from(), X, and Y.
Referenced by wxnviz.Nviz::GetViewpointPosition().
void Nviz_init_rotation | ( | void | ) |
Stop scene rotation.
Definition at line 305 of file change_view.c.
References GS_init_rotation().
Referenced by wxnviz.Nviz::ResetRotation().
int Nviz_look_here | ( | double | sx, |
double | sy | ||
) |
Change focused point.
sx,sy | screen coordinates |
Definition at line 262 of file change_view.c.
References G_debug(), and GS_look_here().
Referenced by wxnviz.Nviz::LookHere().
GL canvas resized.
width | window width |
height | window height |
Definition at line 29 of file change_view.c.
References G_debug(), GS_alldraw_wire(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GS_set_viewport().
Referenced by wxnviz.Nviz::ResizeWindow().
void Nviz_set_rotation | ( | double | angle, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Set rotation parameters.
Rotate scene by given parameters related to mouse drag event (difference from current state). Coordinates determine the second point of rotation axis, the first point is (0, 0, 0).
angle | angle |
x,y,z | axis coordinate |
Definition at line 288 of file change_view.c.
References G_debug(), and GS_set_rotation().
Referenced by wxnviz.Nviz::Rotate().
int Nviz_set_viewpoint_height | ( | double | height | ) |
Change viewpoint height.
data | nviz data |
height | height value (world coordinates) |
Definition at line 157 of file change_view.c.
References G_debug(), GS_get_from_real(), GS_moveto_real(), and height.
Referenced by wxnviz.Nviz::SetView().
Change viewpoint perspective (field of view)
data | nviz data |
persp | perspective value (0-100, in degrees) |
Definition at line 199 of file change_view.c.
References G_debug(), GS_set_fov(), and int.
Referenced by wxnviz.Nviz::SetView().
int Nviz_set_viewpoint_position | ( | double | x_pos, |
double | y_pos | ||
) |
Change position of view.
data | nviz data |
x_pos,y_pos | x,y position (model coordinates) |
Definition at line 96 of file change_view.c.
References G_debug(), GS_get_from(), GS_moveto(), X, and Y.
Referenced by wxnviz.Nviz::SetView().
Change viewpoint twist.
data | nviz data |
persp | twist value (-180-180, in degrees) |
Definition at line 221 of file change_view.c.
References G_debug(), and GS_set_twist().
Referenced by wxnviz.Nviz::SetView().
void Nviz_unset_rotation | ( | void | ) |
Stop scene rotation.
Definition at line 297 of file change_view.c.
References GS_unset_rotation().
Referenced by wxnviz.Nviz::UnsetRotation().
int Nviz_update_ranges | ( | nv_data * | dc | ) |
Update ranges.
Call whenever a new surface is added, deleted, or exag changes
Definition at line 60 of file change_view.c.
References GS_get_longdim(), GS_get_zrange_nz(), and GS_global_exag().
Referenced by Nviz_change_exag(), and Nviz_set_attr().