[GRASS-SVN] r41252 - grass/trunk/display/d.vect
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 1 03:57:00 EST 2010
Author: hamish
Date: 2010-03-01 03:56:59 -0500 (Mon, 01 Mar 2010)
New Revision: 41252
Modified:
grass/trunk/display/d.vect/local_proto.h
grass/trunk/display/d.vect/main.c
grass/trunk/display/d.vect/plot1.c
Log:
use size= option as scale factor when size_column is used
Modified: grass/trunk/display/d.vect/local_proto.h
===================================================================
--- grass/trunk/display/d.vect/local_proto.h 2010-03-01 07:59:36 UTC (rev 41251)
+++ grass/trunk/display/d.vect/local_proto.h 2010-03-01 08:56:59 UTC (rev 41252)
@@ -5,7 +5,7 @@
int close_vect(FILE *);
int plot1(struct Map_info *, int, int, struct cat_list *,
const struct color_rgb *, const struct color_rgb *, int, char *,
- int, char *, char *, int, int, int, char *, int, char *, double,
+ double, char *, char *, int, int, int, char *, int, char *, double,
int, char *);
int label(struct Map_info *, int, int, struct cat_list *, LATTR *, int);
int topo(struct Map_info *, int, int, LATTR *);
Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c 2010-03-01 07:59:36 UTC (rev 41251)
+++ grass/trunk/display/d.vect/main.c 2010-03-01 08:56:59 UTC (rev 41252)
@@ -81,7 +81,7 @@
int r, g, b;
int has_color, has_fcolor;
struct color_rgb color, fcolor;
- int size;
+ double size;
int default_width;
double width_scale;
double minreg, maxreg, reg;
@@ -218,10 +218,12 @@
size_opt = G_define_option();
size_opt->key = "size";
- size_opt->type = TYPE_INTEGER;
+ size_opt->type = TYPE_DOUBLE;
size_opt->answer = "5";
size_opt->guisection = _("Symbols");
- size_opt->description = _("Symbol size");
+ size_opt->label = _("Symbol size");
+ size_opt->description =
+ _("When used with the size_column option this is the scale factor");
sizecolumn_opt = G_define_standard_option(G_OPT_DB_COLUMN);
sizecolumn_opt->key = "size_column";
@@ -428,7 +430,7 @@
G_fatal_error(_("Unknown color: '%s'"), fcolor_opt->answer);
}
- size = atoi(size_opt->answer);
+ size = atof(size_opt->answer);
/* if where_opt was specified select categories from db
* otherwise parse cat_opt */
Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c 2010-03-01 07:59:36 UTC (rev 41251)
+++ grass/trunk/display/d.vect/plot1.c 2010-03-01 08:56:59 UTC (rev 41252)
@@ -40,7 +40,7 @@
/* *************************************************************** */
int plot1(struct Map_info *Map, int type, int area, struct cat_list *Clist,
const struct color_rgb *color, const struct color_rgb *fcolor,
- int chcat, char *symbol_name, int size, char *size_column,
+ int chcat, char *symbol_name, double size, char *size_column,
char *rot_column, int id_flag, int table_colors_flag,
int cats_color_flag, char *rgb_column, int default_width,
char *width_column, double width_scale, int z_color_flag,
@@ -70,7 +70,7 @@
SYMBOL *Symb = NULL;
double var_size, rotation;
- var_size = (double)size;
+ var_size = size;
rotation = 0.0;
nerror_rgb = 0;
@@ -247,7 +247,7 @@
if (Symb == NULL)
G_warning(_("Unable to read symbol, unable to display points"));
else
- S_stroke(Symb, (double)size, 0.0, 0);
+ S_stroke(Symb, size, 0.0, 0);
}
if (open_db)
@@ -493,10 +493,10 @@
/* Read symbol size from db for current symbol # */
if (db_CatValArray_get_value(&cvarr_size, cat, &cv_size) !=
DB_OK) {
- var_size = (double)size;
+ var_size = size;
}
else {
- var_size =
+ var_size = size *
(cvarr_size.ctype == DB_C_TYPE_INT ?
(double)cv_size->val.i : cv_size->val.d);
@@ -504,12 +504,12 @@
G_warning(_("Error in symbol size column (%s), element %d "
"with cat %d: symbol size [%f]"),
size_column, line, cat, var_size);
- var_size = (double)size;
+ var_size = size;
}
}
} /* end if cat */
else {
- var_size = (double)size;
+ var_size = size;
}
} /* end if nrec_size */
@@ -566,7 +566,7 @@
D_symbol(Symb, x0, y0, line_color, fill_color);
/* reset to defaults */
- var_size = (double)size;
+ var_size = size;
rotation = 0.0;
}
else if (color || custom_rgb || (z_color_flag && Vect_is_3d(Map))) {
More information about the grass-commit
mailing list