[GRASS-SVN] r47501 - grass/trunk/display/d.vect
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 9 06:27:22 EDT 2011
Author: mmetz
Date: 2011-08-09 03:27:22 -0700 (Tue, 09 Aug 2011)
New Revision: 47501
Modified:
grass/trunk/display/d.vect/attr.c
grass/trunk/display/d.vect/label.c
grass/trunk/display/d.vect/local_proto.h
grass/trunk/display/d.vect/main.c
grass/trunk/display/d.vect/shape.c
grass/trunk/display/d.vect/topo.c
Log:
d.vect: minor code cleanup
Modified: grass/trunk/display/d.vect/attr.c
===================================================================
--- grass/trunk/display/d.vect/attr.c 2011-08-09 09:43:59 UTC (rev 47500)
+++ grass/trunk/display/d.vect/attr.c 2011-08-09 10:27:22 UTC (rev 47501)
@@ -54,7 +54,7 @@
return 0;
}
- if (!(type & ltype))
+ if (!(type & ltype) && !((type & GV_AREA) && (ltype & GV_CENTROID)))
continue; /* used for both lines and labels */
D_RGB_color(lattr->color.R, lattr->color.G, lattr->color.B);
Modified: grass/trunk/display/d.vect/label.c
===================================================================
--- grass/trunk/display/d.vect/label.c 2011-08-09 09:43:59 UTC (rev 47500)
+++ grass/trunk/display/d.vect/label.c 2011-08-09 10:27:22 UTC (rev 47501)
@@ -5,7 +5,7 @@
#include "local_proto.h"
#include "plot.h"
-int display_label(struct Map_info *Map, int type, int do_area,
+int display_label(struct Map_info *Map, int type,
struct cat_list *Clist, LATTR *lattr, int chcat)
{
int i, ltype;
Modified: grass/trunk/display/d.vect/local_proto.h
===================================================================
--- grass/trunk/display/d.vect/local_proto.h 2011-08-09 09:43:59 UTC (rev 47500)
+++ grass/trunk/display/d.vect/local_proto.h 2011-08-09 10:27:22 UTC (rev 47501)
@@ -22,7 +22,7 @@
int display_dir(struct Map_info *, int, struct cat_list *, int);
/* labels.c */
-int display_label(struct Map_info *, int, int, struct cat_list *, LATTR *, int);
+int display_label(struct Map_info *, int, struct cat_list *, LATTR *, int);
void show_label(double *, double *, LATTR *, const char *);
void show_label_line(const struct line_pnts *, int, LATTR *, const char *);
@@ -37,7 +37,7 @@
dbCatValArray *, int, dbCatValArray *, int);
/* shape.c */
-int display_shape(struct Map_info *, int, int, struct cat_list *, const struct Cell_head *,
+int display_shape(struct Map_info *, int, struct cat_list *, const struct Cell_head *,
const struct color_rgb *, const struct color_rgb *, int,
const char *, double, const char *, int, const char *, /* lines only */
int, int, int, char *,
@@ -54,7 +54,7 @@
void option_to_where(struct Map_info *, struct cat_list *, const char *);
/* topo.c */
-int display_topo(struct Map_info *, int, int, LATTR *);
+int display_topo(struct Map_info *, int, LATTR *);
/* zcoor.c */
int display_zcoor(struct Map_info *, int, LATTR *);
Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c 2011-08-09 09:43:59 UTC (rev 47500)
+++ grass/trunk/display/d.vect/main.c 2011-08-09 10:27:22 UTC (rev 47501)
@@ -74,7 +74,7 @@
int main(int argc, char **argv)
{
int ret, level;
- int stat, type, area, display;
+ int stat, type, display;
int chcat;
int has_color, has_fcolor;
struct color_rgb color, fcolor;
@@ -440,7 +440,6 @@
}
type = Vect_option_to_types(type_opt);
- area = type & GV_AREA;
display = option_to_display(display_opt);
@@ -479,7 +478,7 @@
D_line_width(default_width);
if (display & DISP_SHAPE) {
- stat += display_shape(&Map, type, area, Clist, &window,
+ stat += display_shape(&Map, type, Clist, &window,
has_color ? &color : NULL, has_fcolor ? &fcolor : NULL, chcat,
icon_opt->answer, size, sizecolumn_opt->answer, sqrt_flag->answer ? 1 : 0, rotcolumn_opt->answer,
id_flag->answer ? 1 : 0, table_acolors_flag->answer ? 1 : 0, cats_acolors_flag->answer ? 1 : 0, rgbcol_opt->answer,
@@ -504,22 +503,16 @@
D_line_width(0);
if (display & DISP_CAT)
- stat += display_label(&Map, type, area, Clist, &lattr, chcat);
+ stat += display_label(&Map, type, Clist, &lattr, chcat);
- if (display & DISP_ATTR) {
- int attr_type = type;
+ if (display & DISP_ATTR)
+ stat += display_attr(&Map, type, attrcol_opt->answer, Clist, &lattr, chcat);
- if (area && !(attr_type & GV_CENTROID))
- attr_type |= GV_CENTROID;
-
- stat += display_attr(&Map, attr_type, attrcol_opt->answer, Clist, &lattr, chcat);
- }
-
if (display & DISP_ZCOOR)
stat += display_zcoor(&Map, type, &lattr);
if (display & DISP_TOPO)
- stat += display_topo(&Map, type, area, &lattr);
+ stat += display_topo(&Map, type, &lattr);
}
D_save_command(G_recreate_command());
Modified: grass/trunk/display/d.vect/shape.c
===================================================================
--- grass/trunk/display/d.vect/shape.c 2011-08-09 09:43:59 UTC (rev 47500)
+++ grass/trunk/display/d.vect/shape.c 2011-08-09 10:27:22 UTC (rev 47501)
@@ -4,7 +4,7 @@
#include "local_proto.h"
-int display_shape(struct Map_info *Map, int type, int area, struct cat_list *Clist, const struct Cell_head *window,
+int display_shape(struct Map_info *Map, int type, struct cat_list *Clist, const struct Cell_head *window,
const struct color_rgb *bcolor, const struct color_rgb *fcolor, int chcat,
const char *icon, double size, const char *size_column, int sqrt_flag, const char *rot_column, /* lines only */
int id_flag, int table_colors_flag, int cats_colors_flag, char *rgb_column,
@@ -162,7 +162,7 @@
db_close_database_shutdown_driver(driver);
stat = 0;
- if (area)
+ if (type & GV_AREA)
stat += display_area(Map, Clist, window,
bcolor, fcolor, chcat,
id_flag, table_colors_flag, cats_colors_flag,
Modified: grass/trunk/display/d.vect/topo.c
===================================================================
--- grass/trunk/display/d.vect/topo.c 2011-08-09 09:43:59 UTC (rev 47500)
+++ grass/trunk/display/d.vect/topo.c 2011-08-09 10:27:22 UTC (rev 47501)
@@ -5,7 +5,7 @@
#include "local_proto.h"
#include "plot.h"
-int display_topo(struct Map_info *Map, int type, int do_area, LATTR *lattr)
+int display_topo(struct Map_info *Map, int type, LATTR *lattr)
{
int ltype, num, el;
struct line_pnts *Points;
More information about the grass-commit
mailing list