00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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