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

OGSF library - loading and manipulating point sets. More...

#include <stdlib.h>
#include <math.h>
#include <grass/gstypes.h>
#include "rowcol.h"
Include dependency graph for gpd.c:

Go to the source code of this file.

Macros

#define CHK_FREQ   50
 
#define v_border   50
 

Functions

int gpd_obj_site_attr (geosurf *gs, geosite *gp, geopoint *gpt, Point3 site)
 Substitutes gpd_obj() More...
 
int gs_point_in_region (geosurf *gs, float *pt, float *region)
 Check if point is in region. More...
 
void gpd_obj (geosurf *gs, int color, float size, int marker, Point3 pt)
 ADD. More...
 
int gpd_2dsite (geosite *gp, geosurf *gs, int do_fast)
 ADD. More...
 
int gpd_3dsite (geosite *gp, float xo, float yo, int do_fast)
 ADD. More...
 

Detailed Description

OGSF library - loading and manipulating point sets.

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, GMSL/University of Illinois (December 1993)
Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file gpd.c.

Macro Definition Documentation

#define CHK_FREQ   50

Definition at line 26 of file gpd.c.

Referenced by gpd_2dsite(), and gpd_3dsite().

#define v_border   50

Definition at line 29 of file gpd.c.

Function Documentation

int gpd_2dsite ( geosite *  gp,
geosurf *  gs,
int  do_fast 
)

ADD.

Need to think about translations - If user translates surface, sites should automatically go with it, but translating sites should translate it relative to surface on which it's displayed

Handling mask checking here

Todo:
prevent scaling by 0
Parameters
gpsite (geosite)
gssurface (geosurf)
do_fast(unused)
Returns
0
1

Definition at line 349 of file gpd.c.

References buf, CHK_FREQ, tools::color, gpd_obj_site_attr(), GS_check_cancel(), gs_get_att_src(), gs_get_att_typbuff(), gs_point_in_region(), gs_point_is_masked(), gs_update_curmask(), gsd_checkpoint(), gsd_do_scale(), gsd_getwindow(), gsd_linewidth(), gsd_popmatrix(), gsd_pushmatrix(), gsd_translate(), NULL, tools::size, viewcell_tri_interp(), tools::window, X, and Y.

Referenced by GP_draw_site().

int gpd_3dsite ( geosite *  gp,
float  xo,
float  yo,
int  do_fast 
)

ADD.

Parameters
gpsite (geosite)
xo,yo
do_fast(unused)
Returns
0
1

Definition at line 458 of file gpd.c.

References CHK_FREQ, tools::color, gpd_obj_site_attr(), GS_check_cancel(), GS_global_exag(), gsd_checkpoint(), gsd_do_scale(), gsd_getwindow(), gsd_linewidth(), gsd_popmatrix(), gsd_pushmatrix(), NULL, tools::size, tools::window, X, and Y.

Referenced by GP_draw_site().

void gpd_obj ( geosurf *  gs,
int  color,
float  size,
int  marker,
Point3  pt 
)

ADD.

Do normal transforms before calling

Note gs: NULL if 3d obj or const elev surface

Todo:
add size1, size2 & dir1, dir2 (eg azimuth, elevation) variables
Parameters
gssurface (geosurf)
size
marker
pt3d point (Point3)

Definition at line 202 of file gpd.c.

References GS_global_exag(), GS_v3eq(), gsd_box(), gsd_color_func(), gsd_colormode(), gsd_cube(), gsd_diamond(), gsd_draw_asterisk(), gsd_draw_box(), gsd_draw_gyro(), gsd_popmatrix(), gsd_pushmatrix(), gsd_scale(), gsd_sphere(), gsd_x(), and tools::size.

Referenced by gpd_obj_site_attr(), and GS_draw_X().

int gpd_obj_site_attr ( geosurf *  gs,
geosite *  gp,
geopoint *  gpt,
Point3  site 
)

Substitutes gpd_obj()

Parameters
gssurface (geosurf)
gpsite (geosite)
gptpoint (point)
sitepoint
Returns
0

Definition at line 44 of file gpd.c.

References tools::color, gpd_obj(), GS_global_exag(), int, tools::size, X, y, and Y.

Referenced by gpd_2dsite(), and gpd_3dsite().

int gs_point_in_region ( geosurf *  gs,
float *  pt,
float *  region 
)

Check if point is in region.

Check for cancel every CHK_FREQ points

Parameters
gssurface (geosurf)
ptpoint (array(X,Y,Z))
regionregion settings (array (top,bottom,left,right))
Returns
0 point outside of region
1 point inside region

Definition at line 167 of file gpd.c.

References VCOL2X, VCOLS, VROW2Y, VROWS, X, and Y.

Referenced by gpd_2dsite().