GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
display/draw.c File Reference
#include <grass/raster.h>
#include <grass/gis.h>
#include <grass/display.h>
Include dependency graph for display/draw.c:

Go to the source code of this file.

Macros

#define swap(x, y)   {int t; t=x; x=y; y=t;}
 
#define limit(a, x, b)   x<a?a:(x>b?b:x)
 
#define Y(x)   line_eq(x,x0,y0,dx,dy,xround)
 
#define X(y)   line_eq(y,y0,x0,dy,dx,yround)
 

Functions

int D_set_clip_window (int Top, int Bottom, int Left, int Right)
 set clipping window More...
 
int D_set_clip_window_to_map_window (void)
 set clipping window to map window More...
 
int D_set_clip_window_to_screen_window (void)
 set clipping window to screen window More...
 
int D_cont_abs (int x, int y)
 line to x,y More...
 
int D_cont_rel (int x, int y)
 line to x,y More...
 
int D_move_abs (int x, int y)
 move to pixel More...
 
int D_move_rel (int x, int y)
 move to pixel More...
 

Macro Definition Documentation

#define limit (   a,
  x,
  b 
)    x<a?a:(x>b?b:x)

Definition at line 62 of file display/draw.c.

Referenced by D_set_clip_window().

#define swap (   x,
  y 
)    {int t; t=x; x=y; y=t;}

Definition at line 61 of file display/draw.c.

Referenced by D_set_clip_window().

#define X (   y)    line_eq(y,y0,x0,dy,dx,yround)

Definition at line 248 of file display/draw.c.

Referenced by dir_to_slope_aspect(), do_label_display(), drawchar(), get_diag_intersects(), get_horz_intersects(), get_vert_intersects(), GK_add_key(), gk_follow_frames(), Gp_load_sites(), gpd_2dsite(), gpd_3dsite(), gpd_obj_site_attr(), gs_clip_segment(), GS_distance(), GS_draw_flowline_at_xy(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), GS_dv3norm(), GS_get_cat_at_xy(), gs_get_databounds_planes(), gs_get_datacenter(), GS_get_distance_alongsurf(), GS_get_modelposition(), GS_get_modelposition1(), GS_get_norm_at_xy(), GS_get_selected_point_on_surface(), GS_get_to_real(), GS_get_val_at_xy(), GS_getlight_position(), GS_init_view(), GS_is_masked(), Gs_load_3dview(), GS_look_here(), gs_los_intersect(), gs_los_intersect1(), GS_new_light(), GS_P2distance(), gs_point_in_region(), gs_point_is_masked(), gs_put_label(), Gs_save_3dview(), GS_set_focus_center_map(), GS_set_focus_real(), GS_set_Narrow(), GS_setlight_position(), GS_v2dir(), GS_v2norm(), GS_v3add(), GS_v3cross(), GS_v3dir(), GS_v3eq(), GS_v3mag(), GS_v3mult(), GS_v3norm(), GS_v3normalize(), GS_v3sub(), gsd_3darrow(), gsd_3dcursor(), gsd_arrow(), gsd_arrow_onsurf(), gsd_box(), gsd_checkpoint(), gsd_coarse_surf_map(), gsd_cplane_setrot(), gsd_cplane_settrans(), gsd_cube(), gsd_deflight(), gsd_diamond(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_cplane_fence(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_get_cplanes(), gsd_get_los(), gsd_get_zup(), gsd_model2real(), gsd_model2surf(), gsd_nline_onsurf(), gsd_norm_arrows(), gsd_north_arrow(), gsd_ortho_wall(), gsd_plus(), gsd_put_legend(), gsd_real2model(), gsd_real2surf(), gsd_scalebar(), gsd_scalebar_v2(), gsd_set_view(), gsd_surf2model(), gsd_surf2real(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gsd_update_cpnorm(), gsd_wall(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsd_x(), gsd_zup_twist(), gsdrape_get_segments(), Gv_load_vect(), gvd_vect(), GVL_set_focus_center_map(), GVL_slice_get_pos(), GVL_slice_set_pos(), gvld_isosurf(), gvld_slice(), gvld_wind3_box(), gvld_wire_slices(), interp_first_last(), Nviz_flythrough(), Nviz_get_cplane_rotation(), Nviz_get_cplane_translation(), Nviz_get_viewpoint_position(), Nviz_new_cplane(), Nviz_set_cplane_here(), Nviz_set_cplane_rotation(), Nviz_set_cplane_translation(), Nviz_set_viewpoint_position(), order_intersects(), P3toPlane(), primitive_cone(), print_frto(), print_realto(), print_view_fields(), seg_intersect_vregion(), slice_calc(), V3Cross(), viewcell_tri_interp(), and XY_intersect_plane().

#define Y (   x)    line_eq(x,x0,y0,dx,dy,xround)

Definition at line 246 of file display/draw.c.

Referenced by dir_to_slope_aspect(), do_label_display(), drawchar(), get_diag_intersects(), get_horz_intersects(), get_vert_intersects(), GK_add_key(), gk_follow_frames(), Gp_load_sites(), gpd_2dsite(), gpd_3dsite(), gpd_obj_site_attr(), gs_clip_segment(), GS_distance(), GS_draw_flowline_at_xy(), GS_draw_line_onsurf(), GS_draw_nline_onsurf(), GS_draw_X(), GS_dv3norm(), GS_get_cat_at_xy(), gs_get_databounds_planes(), gs_get_datacenter(), GS_get_distance_alongsurf(), GS_get_modelposition(), GS_get_modelposition1(), GS_get_norm_at_xy(), GS_get_selected_point_on_surface(), GS_get_to_real(), GS_get_val_at_xy(), GS_getlight_position(), GS_init_view(), GS_is_masked(), Gs_load_3dview(), GS_look_here(), gs_los_intersect(), gs_los_intersect1(), GS_new_light(), GS_P2distance(), gs_point_in_region(), gs_point_is_masked(), gs_put_label(), Gs_save_3dview(), GS_set_focus_center_map(), GS_set_focus_real(), GS_set_Narrow(), GS_setlight_position(), GS_v2dir(), GS_v2norm(), GS_v3add(), GS_v3cross(), GS_v3dir(), GS_v3eq(), GS_v3mag(), GS_v3mult(), GS_v3norm(), GS_v3normalize(), GS_v3sub(), gsd_3darrow(), gsd_3dcursor(), gsd_arrow(), gsd_arrow_onsurf(), gsd_box(), gsd_checkpoint(), gsd_coarse_surf_map(), gsd_cplane_setrot(), gsd_cplane_settrans(), gsd_cube(), gsd_deflight(), gsd_diamond(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_cplane(), gsd_draw_cplane_fence(), gsd_draw_gyro(), gsd_fringe_horiz_line(), gsd_fringe_horiz_line2(), gsd_fringe_horiz_poly(), gsd_fringe_vert_line(), gsd_fringe_vert_poly(), gsd_get_cplanes(), gsd_get_los(), gsd_get_zup(), gsd_model2real(), gsd_model2surf(), gsd_nline_onsurf(), gsd_norm_arrows(), gsd_north_arrow(), gsd_ortho_wall(), gsd_plus(), gsd_put_legend(), gsd_real2model(), gsd_real2surf(), gsd_scalebar(), gsd_scalebar_v2(), gsd_set_view(), gsd_surf2model(), gsd_surf2real(), gsd_surf_const(), gsd_surf_map(), gsd_surf_map_old(), gsd_triangulated_wall(), gsd_update_cpnorm(), gsd_wall(), gsd_wire_arrows(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsd_x(), gsd_zup_twist(), gsdrape_get_segments(), Gv_load_vect(), gvd_vect(), GVL_set_focus_center_map(), GVL_slice_get_pos(), GVL_slice_set_pos(), gvld_isosurf(), gvld_slice(), gvld_wind3_box(), gvld_wire_slices(), interp_first_last(), Nviz_flythrough(), Nviz_get_cplane_rotation(), Nviz_get_cplane_translation(), Nviz_get_viewpoint_position(), Nviz_new_cplane(), Nviz_set_cplane_here(), Nviz_set_cplane_rotation(), Nviz_set_cplane_translation(), Nviz_set_viewpoint_position(), order_intersects(), P3toPlane(), primitive_cone(), print_frto(), print_realto(), print_view_fields(), seg_intersect_vregion(), slice_calc(), V3Cross(), viewcell_tri_interp(), and XY_intersect_plane().

Function Documentation

int D_cont_abs ( int  x,
int  y 
)

line to x,y

Draws a line from the current position to pixel location x,y. Any part of the line that falls outside the clipping window is not drawn. Note. The new position is x,y, even if it falls outside the clipping window. Returns 0 if the line was contained entirely in the clipping window, 1 if the line had to be clipped to draw it.

Parameters
x
y
Returns
int

Definition at line 162 of file display/draw.c.

References D_set_clip_window_to_map_window(), R_cont_abs(), R_move_abs(), and y.

Referenced by D_cont_rel().

int D_cont_rel ( int  x,
int  y 
)

line to x,y

Equivalent to D_cont_abs(curx+x, cury+y) where curx, cury is the current pixel location.

Parameters
x
y
Returns
int

Definition at line 198 of file display/draw.c.

References D_cont_abs().

int D_move_abs ( int  x,
int  y 
)

move to pixel

Move without drawing to pixel location x,y, even if it falls outside the clipping window.

Parameters
x
y
Returns
int

Definition at line 215 of file display/draw.c.

References y.

Referenced by D_setup().

int D_move_rel ( int  x,
int  y 
)

move to pixel

Equivalent to D_move_abs(curx+x, cury+y) where curx, cury is the current pixel location.

Parameters
x
y
Returns
int

Definition at line 235 of file display/draw.c.

References y.

int D_set_clip_window ( int  Top,
int  Bottom,
int  Left,
int  Right 
)

set clipping window

Sets the clipping window to the pixel window that corresponds to the current database region. This is the default.

Parameters
top
bottom
left
right
Returns
int

Definition at line 78 of file display/draw.c.

References D_get_screen_window(), limit, R_move_abs(), and swap.

Referenced by D_set_clip_window_to_map_window(), and D_set_clip_window_to_screen_window().

int D_set_clip_window_to_map_window ( void  )

set clipping window to map window

Sets the clipping window to the pixel window that corresponds to the current database region. This is the default.

Parameters
~
Returns
int

Definition at line 117 of file display/draw.c.

References D_get_d_east(), D_get_d_north(), D_get_d_south(), D_get_d_west(), and D_set_clip_window().

Referenced by D_cont_abs().

int D_set_clip_window_to_screen_window ( void  )

set clipping window to screen window

Sets the clipping window to the pixel window that corresponds to the full screen window. Off screen rendering is still clipped.

Parameters
~
Returns
int

Definition at line 138 of file display/draw.c.

References D_get_screen_window(), and D_set_clip_window().