GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71806
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gpd.c File Reference

OGSF library - loading and manipulating point sets (lower level) More...

#include <stdlib.h>
#include <math.h>
#include <grass/ogsf.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 gs_point_in_region (geosurf *gs, float *pt, float *region)
 Check if point is in region. More...
 
void gpd_obj (geosurf *gs, gvstyle *style, Point3 pt)
 Draw point representing object. More...
 
int gpd_2dsite (geosite *gp, geosurf *gs, int do_fast)
 Draw 2D point set. More...
 
int gpd_3dsite (geosite *gp, float xo, float yo, int do_fast)
 Draw 3D point set. More...
 

Detailed Description

OGSF library - loading and manipulating point sets (lower level)

(C) 1999-2008, 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
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 22 of file gpd.c.

Referenced by gpd_2dsite(), and gpd_3dsite().

#define v_border   50

Definition at line 25 of file gpd.c.

Function Documentation

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

Draw 2D point set.

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 on failure
1 on success

Definition at line 216 of file gpd.c.

References g_vect_style_thematic::active, g_surf::att, ATT_TOPO, CHK_FREQ, CONST_ATT, gsurf_att::constant, gpd_obj(), 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(), g_point::highlighted, g_site::hstyle, MAP_ATT, g_point::next, NULL, g_surf::ox, g_surf::oy, g_point::p3, g_site::points, g_point::style, g_site::style, g_site::tstyle, viewcell_tri_interp(), g_vect_style::width, X, g_surf::x_trans, g_site::x_trans, Y, g_surf::y_trans, g_site::y_trans, Z, g_surf::z_trans, and g_site::z_trans.

Referenced by GP_draw_site().

int gpd_3dsite ( geosite gp,
float  xo,
float  yo,
int  do_fast 
)
void gpd_obj ( geosurf gs,
gvstyle style,
Point3  pt 
)

Draw point representing object.

Do normal transforms before calling

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

Parameters
gssurface (geosurf)
styleobject displaying style (highlighted or not)
pt3d point (Point3)

Definition at line 71 of file gpd.c.

References CM_COLOR, CM_DIFFUSE, g_vect_style::color, 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(), g_vect_style::size, ST_ASTER, ST_BOX, ST_CUBE, ST_DIAMOND, ST_GYRO, ST_HISTOGRAM, ST_SPHERE, ST_X, g_vect_style::symbol, and Z.

Referenced by gpd_2dsite(), gpd_3dsite(), and GS_draw_X().

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 39 of file gpd.c.

References VCOL2X, VCOLS, VROW2Y, VROWS, X, Y, and g_surf::yrange.

Referenced by gpd_2dsite().