[GRASS-SVN] r38991 - grass/branches/develbranch_6/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 5 13:04:09 EDT 2009


Author: benducke
Date: 2009-09-05 13:04:08 -0400 (Sat, 05 Sep 2009)
New Revision: 38991

Modified:
   grass/branches/develbranch_6/lib/gis/parser.c
Log:
Add G_OPT_V3_TYPE which includes 2D and 3D vector primitives (for now +KERNELS and +FACES)

Modified: grass/branches/develbranch_6/lib/gis/parser.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/parser.c	2009-09-05 17:01:13 UTC (rev 38990)
+++ grass/branches/develbranch_6/lib/gis/parser.c	2009-09-05 17:04:08 UTC (rev 38991)
@@ -51,7 +51,7 @@
  *    is part of the first option (flags do not count).
  *
  * command num=12
- *    This command line is in error in two ways.  The user will be told 
+ *    This command line is in error in two ways.  The user will be told
  *    that the "map" option is required and also that the number 12 is
  *    out of range.  The acceptable range (or list) will be printed.
  *
@@ -146,10 +146,10 @@
 /**
  * \brief Disables the ability of the parser to operate interactively.
  *
- * When a user calls a command with no arguments on the command line, 
- * the parser will enter its own standardized interactive session in 
- * which all flags and options  are presented to the user for input. A 
- * call to <i>G_disable_interactive()</i> disables the parser's 
+ * When a user calls a command with no arguments on the command line,
+ * the parser will enter its own standardized interactive session in
+ * which all flags and options  are presented to the user for input. A
+ * call to <i>G_disable_interactive()</i> disables the parser's
  * interactive prompting.
  *
  * \return always returns 0
@@ -166,7 +166,7 @@
 /**
  * \brief Initializes a Flag struct.
  *
- * Allocates memory for the Flag structure and returns a pointer to this 
+ * Allocates memory for the Flag structure and returns a pointer to this
  * memory (of <i>type struct Flag *</i>).<br>
  *
  * Flags are always represented by single letters.  A user "turns them on"
@@ -223,10 +223,10 @@
  * this memory (of <i>type struct Option *</i>).<br>
  *
  * Options are provided by user on command line using the standard
- * format: <i>key=value</i>. Options identified as REQUIRED must be 
- * specified by user on command line. The option string can either 
- * specify a range of values (e.g. "10-100") or a list of acceptable 
- * values (e.g. "red,orange,yellow").  Unless the option string is NULL, 
+ * format: <i>key=value</i>. Options identified as REQUIRED must be
+ * specified by user on command line. The option string can either
+ * specify a range of values (e.g. "10-100") or a list of acceptable
+ * values (e.g. "red,orange,yellow").  Unless the option string is NULL,
  * user provided input will be evaluated agaist this string.
  *
  * \return Option * Pointer to an Option struct
@@ -294,7 +294,7 @@
  * It allocates memory for the Option structure and returns a pointer to
  * this memory (of <i>type struct Option *</i>).<br>
  *
- * If an invalid parameter was specified a empty Option structure will 
+ * If an invalid parameter was specified a empty Option structure will
  * be returned (not NULL).
  *
  *  - general: G_OPT_WHERE, G_OPT_COLUMN, G_OPT_COLUMNS, G_OPT_TABLE, G_OPT_DRIVER, G_OPT_DATABASE
@@ -565,6 +565,15 @@
 	Opt->options = "point,line,boundary,centroid,area";
 	Opt->description = _("Feature type");
 	break;
+    case G_OPT_V3_TYPE:
+	Opt->key = "type";
+	Opt->type = TYPE_STRING;
+	Opt->required = NO;
+	Opt->multiple = YES;
+	Opt->answer = "point,line,boundary,centroid,area,face,kernel";
+	Opt->options = "point,line,boundary,centroid,area,face,kernel";
+	Opt->description = _("Feature type");
+	break;
     case G_OPT_V_FIELD:
 	Opt->key = "layer";
 	Opt->type = TYPE_INTEGER;
@@ -575,7 +584,7 @@
 	    _("A single vector map can be connected to multiple database "
 	      "tables. This number determines which table to use.");
 	Opt->gisprompt = "old_layer,layer,layer";
-	
+
 	break;
     case G_OPT_V_CAT:
 	Opt->key = "cat";
@@ -686,13 +695,13 @@
 /**
  * \brief Parse command line.
  *
- * The command line parameters <b>argv</b> and the number of parameters 
- * <b>argc</b> from the main() routine are passed directly to 
- * <i>G_parser()</i>. <i>G_parser()</i> accepts the command line input 
- * entered by the user, and parses this input according to the input 
+ * The command line parameters <b>argv</b> and the number of parameters
+ * <b>argc</b> from the main() routine are passed directly to
+ * <i>G_parser()</i>. <i>G_parser()</i> accepts the command line input
+ * entered by the user, and parses this input according to the input
  * options and/or flags that were defined by the programmer.<br>
  *
- * <b>Note:</b> The only functions which can legitimately be called 
+ * <b>Note:</b> The only functions which can legitimately be called
  * before G_parser() are:<br>
  * <ul>
  *  <li>G_gisinit()</li>
@@ -1007,20 +1016,20 @@
 /**
  * \brief Command line help/usage message.
  *
- * Calls to <i>G_usage()</i> allow the programmer to print the usage 
- * message at any time. This will explain the allowed and required 
- * command line input to the user. This description is given according 
- * to the programmer's definitions for options and flags. This function 
- * becomes useful when the user enters options and/or flags on the 
- * command line that are syntactically valid to the parser, but 
+ * Calls to <i>G_usage()</i> allow the programmer to print the usage
+ * message at any time. This will explain the allowed and required
+ * command line input to the user. This description is given according
+ * to the programmer's definitions for options and flags. This function
+ * becomes useful when the user enters options and/or flags on the
+ * command line that are syntactically valid to the parser, but
  * functionally invalid for the command (e.g. an invalid file name.)<br>
- * For example, the parser logic doesn't directly support grouping 
- * options. If two options be specified together or not at all, the 
- * parser must be told that these options are not required and the 
- * programmer must check that if one is specified the other must be as 
- * well. If this additional check fails, then <i>G_parser()</i> will 
- * succeed, but the programmer can then call <i>G_usage()</i>  to print 
- * the standard usage message and print additional information about how 
+ * For example, the parser logic doesn't directly support grouping
+ * options. If two options be specified together or not at all, the
+ * parser must be told that these options are not required and the
+ * programmer must check that if one is specified the other must be as
+ * well. If this additional check fails, then <i>G_parser()</i> will
+ * succeed, but the programmer can then call <i>G_usage()</i>  to print
+ * the standard usage message and print additional information about how
  * the two options work together.
  *
  * \return always returns 0
@@ -1303,7 +1312,7 @@
 	fprintf(stdout, "\n\t</keywords>\n");
     }
 
-	/***** Don't use parameter-groups for now.  We'll reimplement this later 
+	/***** Don't use parameter-groups for now.  We'll reimplement this later
 	 ***** when we have a concept of several mutually exclusive option
 	 ***** groups
 	if (n_opts || n_flags)
@@ -1451,7 +1460,7 @@
 	}
     }
 
-	/***** Don't use parameter-groups for now.  We'll reimplement this later 
+	/***** Don't use parameter-groups for now.  We'll reimplement this later
 	 ***** when we have a concept of several mutually exclusive option
 	 ***** groups
 	if (n_opts || n_flags)
@@ -1985,7 +1994,7 @@
 }
 
 /**
-   \brief Invoke GUI dialog 
+   \brief Invoke GUI dialog
 
    Use G_gui_wx() or G_gui_tcltk() to generate GUI dialog.
 
@@ -2009,7 +2018,7 @@
 }
 
 /**
-   \brief Send Tcl/Tk code to tcltkgrass 
+   \brief Send Tcl/Tk code to tcltkgrass
 **/
 static void G_tcltk(void)
 {
@@ -2771,7 +2780,7 @@
     else {
 	return -1;
     }
-    
+
     if (ptr1 == '\0')
 	*buff = '\0';
 



More information about the grass-commit mailing list