Loading...
Searching...
No Matches
gsd_views.c File Reference

OGSF library - manipulating views (lower level functions). More...

`#include <grass/config.h>`
`#include <grass/ogsf.h>`
`#include "math.h"`
Include dependency graph for gsd_views.c:

Go to the source code of this file.

## Functions

int | gsd_get_los (float(*vect)[3], short sx, short sy)
| ADD.
void | gsd_set_view (geoview *gv, geodisplay *gd)
| Set view.
void | gsd_check_focus (geoview *gv)
| Check focus.
void | gsd_get_zup (geoview *gv, double *up)
| Get z-up vector (z-direction).
int | gsd_zup_twist (geoview *gv)
| ADD.
void | gsd_do_scale (int doexag)
| Set current scale.
void | gsd_real2model (Point3 point)
| Convert real to model coordinates.
void | gsd_model2real (Point3 point)
| Convert model to real coordinates.
void | gsd_model2surf (geosurf *gs, Point3 point)
| Convert model to surface coordinates.
void | gsd_surf2model (Point3 point)
| Convert surface to model coordinates.
void | gsd_surf2real (geosurf *gs, Point3 point)
| Convert surface to real coordinates.
void | gsd_real2surf (geosurf *gs, Point3 point)
| Convert real to surface coordinates.

## Detailed Description

OGSF library - manipulating views (lower level functions).

GRASS OpenGL gsurf OGSF Library

(C) 1999-2008 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.

Author
  Bill Brown USACERL (January 1993)
  Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gsd_views.c.

## Function Documentation

## gsd_check_focus()

void gsd_check_focus | ( | geoview * | gv | ) |

Check focus.

Parameters

  gv | view (geoview)

Definition at line 216 of file gsd_views.c.

References GS_get_zrange(), GS_v3eq(), GS_v3mult(), and GS_v3normalize().

Referenced by gsd_set_view().

## gsd_do_scale()

void gsd_do_scale | ( | int | doexag | ) |

Set current scale.

Parameters

  doexag | use z-exaggeration

Definition at line 355 of file gsd_views.c.

References GS_get_scale(), GS_get_zrange(), gsd_scale(), gsd_translate(), max, and min.

Referenced by gpd_2dsite(), gpd_3dsite(), GS_draw_lighting_model1(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), GS_set_Narrow(), gsd_coarse_surf_map(), gsd_draw_cplane(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_get_los(), gsd_getwindow(), gsd_norm_arrows(), gsd_north_arrow(), gsd_ortho_wall(), gsd_scalebar(), gsd_scalebar_v2(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gvd_vect(), gvld_isosurf(), gvld_slices(), gvld_wind3_box(), and gvld_wire_slices().

## gsd_get_los()

int gsd_get_los | ( | float(*) | vect[3],
|  | short | sx,
|  | short | sy )

ADD.

Parameters

  vect |
  sx,sy | screen coordinates

Returns
  1

Definition at line 40 of file gsd_views.c.

References GS_ready_draw(), GS_set_draw(), gsd_color_func(), gsd_do_scale(), gsd_linewidth(), X, and Y.

Referenced by GS_get_selected_point_on_surface(), GS_look_here(), and Nviz_set_cplane_here().

## gsd_get_zup()

void gsd_get_zup | ( | geoview * | gv,
|  | double * | up )

Get z-up vector (z-direction).

Parameters

  gv | view (geoview)
  up | up vector

Definition at line 240 of file gsd_views.c.

References GS_v3dir(), X, and Y.

Referenced by gsd_set_view().

## gsd_model2real()

void gsd_model2real | ( | Point3 | point | ) |

Convert model to real coordinates.

Parameters

  [in,out] | point | 3d point (x,y,z)

Definition at line 393 of file gsd_views.c.

References GS_get_region(), GS_get_scale(), GS_get_zrange(), max, min, X, and Y.

Referenced by GS_get_from_real(), and Gs_save_3dview().

## gsd_model2surf()

void gsd_model2surf | ( | geosurf * | gs,
|  | Point3 | point )

Convert model to surface coordinates.

Parameters

  gs | surface (geosurf)
  point | 3d point (Point3)

Definition at line 414 of file gsd_views.c.

References GS_get_scale(), GS_get_zrange(), max, min, X, and Y.

## gsd_real2model()

void gsd_real2model | ( | Point3 | point | ) |

Convert real to model coordinates.

Parameters

  [in,out] | point | 3d point (Point3)

Definition at line 373 of file gsd_views.c.

References GS_get_region(), GS_get_scale(), GS_get_zrange(), max, min, X, and Y.

Referenced by GS_moveto_real().

## gsd_real2surf()

void gsd_real2surf | ( | geosurf * | gs,
|  | Point3 | point )

Convert real to surface coordinates.

Parameters

  | gs | surface (geosurf)
  [in,out] | point | 3d point (Point3)

Definition at line 481 of file gsd_views.c.

References X, and Y.

Referenced by GS_get_cat_at_xy(), GS_get_distance_alongsurf(), GS_get_norm_at_xy(), and GS_get_val_at_xy().

## gsd_set_view()

void gsd_set_view | ( | geoview * | gv,
|  | geodisplay * | gd )

Set view.

Establishes viewing & projection matrices

Parameters

  gv | view (geoview)
  gd | display (geodisplay)

Definition at line 146 of file gsd_views.c.

References GS_get_aspect(), gs_get_datacenter(), gsd_check_focus(), gsd_get_zup(), gsd_surf2model(), gsd_update_cplanes(), X, and Y.

Referenced by GS_ready_draw(), GS_set_focus(), GS_set_focus_real(), and GS_set_viewdir().

## gsd_surf2model()

void gsd_surf2model | ( | Point3 | point | ) |

Convert surface to model coordinates.

Parameters

  point | 3d point (Point3)

Definition at line 442 of file gsd_views.c.

References GS_get_scale(), GS_get_zrange(), max, min, X, and Y.

Referenced by gsd_set_view().

## gsd_surf2real()

void gsd_surf2real | ( | geosurf * | gs,
|  | Point3 | point )

Convert surface to real coordinates.

Parameters

  | gs | surface (geosurf)
  [in,out] | point | 3d point (Point3)

Definition at line 465 of file gsd_views.c.

References X, and Y.

Referenced by GS_draw_nline_onsurf(), and GS_get_selected_point_on_surface().

## gsd_zup_twist()

int gsd_zup_twist | ( | geoview * | gv | ) |

ADD.

Parameters

  gv | view (geoview)

Returns
  ?

Definition at line 274 of file gsd_views.c.

References GS_distance(), GS_v3eq(), X, and Y.