Vlib/type.c

Go to the documentation of this file.
00001 /****************************************************************************
00002 *
00003 * MODULE:       Vector library 
00004 *               
00005 * AUTHOR(S):    Radim Blazek
00006 *
00007 * PURPOSE:      Higher level functions for reading/writing/manipulating vectors.
00008 *
00009 * COPYRIGHT:    (C) 2001 by the GRASS Development Team
00010 *
00011 *               This program is free software under the GNU General Public
00012 *               License (>=v2). Read the file COPYING that comes with GRASS
00013 *               for details.
00014 *
00015 *****************************************************************************/
00016 #include <grass/gis.h>
00017 #include <grass/Vect.h>
00018 
00025 int
00026 Vect_option_to_types (struct Option *type_opt )
00027 {
00028     int i = 0;
00029     int type = 0; 
00030 
00031     while (type_opt->answers[i]) {
00032         switch ( type_opt->answers[i][0] ) {
00033             case 'p':
00034                 type |= GV_POINT;
00035                 break;
00036             case 'l':
00037                 type |= GV_LINE;
00038                 break;
00039             case 'b':
00040                 type |= GV_BOUNDARY;
00041                 break;
00042             case 'c':
00043                 type |= GV_CENTROID;
00044                 break;
00045             case 'f':
00046                 type |= GV_FACE;
00047                 break;
00048             case 'k':
00049                 type |= GV_KERNEL;
00050                 break;
00051             case 'a':
00052                 type |= GV_AREA;
00053                 break;
00054             case 'v':
00055                 type |= GV_VOLUME;
00056                 break;
00057         }
00058         i++;
00059     }
00060 
00061     return type;
00062 }
00063 

Generated on Sun Apr 6 17:32:44 2008 for GRASS by  doxygen 1.5.5