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

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

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/site.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
#include <grass/gstypes.h>
Include dependency graph for Gp3.c:

Go to the source code of this file.

Functions

int Gp_set_color (const char *grassname, geopoint *gp)
 Set color for point set. More...
 
geopoint * Gp_load_sites (const char *grassname, int *nsites, int *has_z, int *has_att)
 Load to points to memory. More...
 

Detailed Description

OGSF library - loading point sets (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, GMSL/University of Illinois (January 1994)
Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)

Definition in file Gp3.c.

Function Documentation

geopoint* Gp_load_sites ( const char *  grassname,
int nsites,
int has_z,
int has_att 
)

Load to points to memory.

The other alternative may be to load to a tmp file.

Parameters
grassnamevector point map
nsites
has_z2D or 3D points?
has_attattributes included
Returns
pointer to geopoint struct
NULL on failure

Definition at line 90 of file Gp3.c.

References FALSE, G_debug(), G_fatal_error(), G_find_vector2(), G_free(), G_fully_qualified_name(), G_get_set_window(), G_message(), G_warning(), NULL, Vect_close(), Vect_is_3d(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_open_old(), Vect_read_next_line(), Vect_set_constraint_region(), Vect_set_open_level(), X, and Y.

Referenced by GP_load_site().

int Gp_set_color ( const char *  grassname,
geopoint *  gp 
)

Set color for point set.

used when site attribute mode is ST_ATT_COLOR

Gets color structure for grass file, goes through points and uses fattr as CAT, putting rgb color in iattr.

Parameters
grassnameraster map name
gppointer to geopoint struct
Returns
1 on success
0 on failure

Definition at line 41 of file Gp3.c.

References b, cat, tools::color, g, G_find_cell2(), G_get_color(), G_read_colors(), G_warning(), if(), int, and r.

Referenced by GP_attmode_color().