GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
nviz/draw.c File Reference

Nviz library – Draw map objects to GLX context. More...

#include <grass/nviz.h>
Include dependency graph for nviz/draw.c:

Go to the source code of this file.

Macros

#define GL_CLAMP_TO_EDGE   0x812F
 

Functions

int Nviz_draw_all_surf (nv_data *dc)
 Draw all loaded surfaces. More...
 
int Nviz_draw_all_vect ()
 Draw all loaded vector sets (lines) More...
 
int Nviz_draw_all_site ()
 Draw all loaded vector point sets. More...
 
int Nviz_draw_all_vol ()
 Draw all loaded volume sets. More...
 
int Nviz_draw_all (nv_data *data)
 Draw all map objects (in full resolution) and decorations. More...
 
int Nviz_draw_quick (nv_data *data, int draw_mode)
 Draw all surfaces in wireframe (quick mode) More...
 
int Nviz_load_image (GLubyte *image_data, int width, int height, int alpha)
 Load image into texture. More...
 
void Nviz_set_2D (int width, int height)
 Set ortho view for drawing images. More...
 
void Nviz_draw_image (int x, int y, int width, int height, int texture_id)
 Draw image as texture. More...
 
void Nviz_del_texture (int texture_id)
 Delete texture. More...
 
void Nviz_get_max_texture (int *size)
 Get maximum texture size. More...
 

Detailed Description

Nviz library – Draw map objects to GLX context.

Based on visualization/nviz/src/draw.c and visualization/nviz/src/togl_flythrough.c

(C) 2008, 2010-2011 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
Updated/modified by Martin Landa <landa.martin gmail.com> (Google SoC 2008/2010)
Textures by Anna Kratochvilova

Definition in file nviz/draw.c.

Macro Definition Documentation

#define GL_CLAMP_TO_EDGE   0x812F

Definition at line 20 of file nviz/draw.c.

Referenced by Nviz_load_image().

Function Documentation

void Nviz_del_texture ( int  texture_id)

Delete texture.

Parameters
texture_idtexture id

Definition at line 407 of file nviz/draw.c.

Referenced by wxnviz.Texture::__del__().

int Nviz_draw_all ( nv_data *  data)

Draw all map objects (in full resolution) and decorations.

Parameters
datanviz data

Definition at line 204 of file nviz/draw.c.

References GS_clear(), GS_done_draw(), GS_draw_fringe(), GS_ready_draw(), GS_set_draw(), gsd_north_arrow(), gsd_scalebar_v2(), NULL, Nviz_draw_all_site(), Nviz_draw_all_surf(), Nviz_draw_all_vect(), Nviz_draw_all_vol(), and dialogs::s.

Referenced by wxnviz.Nviz::Draw().

int Nviz_draw_all_site ( )

Draw all loaded vector point sets.

Returns
1

Definition at line 146 of file nviz/draw.c.

References G_free(), GP_draw_site(), GP_get_site_list(), GS_done_draw(), GS_ready_draw(), and GS_set_draw().

Referenced by Nviz_draw_all().

int Nviz_draw_all_surf ( nv_data *  dc)

Draw all loaded surfaces.

Parameters
dcnviz data
Returns
1

Definition at line 32 of file nviz/draw.c.

References G_free(), GS_draw_cplane_fence(), GS_draw_surf(), GS_get_surf_list(), GS_setlight_position(), num, dialogs::w, and y.

Referenced by Nviz_draw_all().

int Nviz_draw_all_vect ( )

Draw all loaded vector sets (lines)

Returns
1

Definition at line 121 of file nviz/draw.c.

References GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GV_alldraw_vect().

Referenced by Nviz_draw_all().

int Nviz_draw_all_vol ( )

Draw all loaded volume sets.

Returns
1

Definition at line 175 of file nviz/draw.c.

References G_free(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), GVL_draw_vol(), and GVL_get_vol_list().

Referenced by Nviz_draw_all().

void Nviz_draw_image ( int  x,
int  y,
int  width,
int  height,
int  texture_id 
)

Draw image as texture.

Parameters
x,yimage coordinates
width,heightimage size
texture_idtexture id

Definition at line 378 of file nviz/draw.c.

References GS_done_draw(), and GS_set_draw().

Referenced by wxnviz.Texture::Draw().

int Nviz_draw_quick ( nv_data *  data,
int  draw_mode 
)

Draw all surfaces in wireframe (quick mode)

Draw modes:

  • DRAW_QUICK_SURFACE
  • DRAW_QUICK_VLINES
  • DRAW_QUICK_VPOINTS
  • DRAW_QUICK_VOLUME
Parameters
datanviz data
draw_modedraw mode
Returns
1

Definition at line 278 of file nviz/draw.c.

References GP_alldraw_site(), GS_alldraw_wire(), GS_clear(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), GV_alldraw_vect(), and GVL_alldraw_wire().

Referenced by wxnviz.Nviz::Draw().

void Nviz_get_max_texture ( int size)

Get maximum texture size.

Definition at line 419 of file nviz/draw.c.

int Nviz_load_image ( GLubyte *  image_data,
int  width,
int  height,
int  alpha 
)

Load image into texture.

Parameters
image_dataimage data
width,heightimage screen size
alphahas alpha channel

Definition at line 315 of file nviz/draw.c.

References GL_CLAMP_TO_EDGE.

Referenced by wxnviz.Texture::Load().

void Nviz_set_2D ( int  width,
int  height 
)

Set ortho view for drawing images.

Parameters
width,heightimage screen size

Definition at line 354 of file nviz/draw.c.

Referenced by wxnviz.Nviz::Start2D().