[GRASS-SVN] r69154 - grass/trunk/display/d.vect.thematic

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 18 08:12:39 PDT 2016


Author: annakrat
Date: 2016-08-18 08:12:39 -0700 (Thu, 18 Aug 2016)
New Revision: 69154

Modified:
   grass/trunk/display/d.vect.thematic/display.c
   grass/trunk/display/d.vect.thematic/local_proto.h
   grass/trunk/display/d.vect.thematic/main.c
Log:
d.vect.thematic: use correctly colors for different symbols, author Adam Laza

Modified: grass/trunk/display/d.vect.thematic/display.c
===================================================================
--- grass/trunk/display/d.vect.thematic/display.c	2016-08-18 14:34:33 UTC (rev 69153)
+++ grass/trunk/display/d.vect.thematic/display.c	2016-08-18 15:12:39 UTC (rev 69154)
@@ -19,14 +19,15 @@
 int display_lines(struct Map_info *Map, struct cat_list *Clist,
                   int chcat, const char *symbol_name, double size,
                   int default_width, dbCatValArray * cvarr, double *breaks,
-                  int nbreaks, const struct color_rgb *colors)
+                  int nbreaks, const struct color_rgb *colors, const struct
+                  color_rgb *bcolor)
 {
     int ltype, line, nlines;
     struct line_pnts *Points;
     struct line_cats *Cats;
 
     int n_points, n_lines, n_centroids, n_boundaries, n_faces;
-    RGBA_Color *primary_color, *sec_color;
+    RGBA_Color *primary_color, *secondary_color;
     SYMBOL *Symb;
 
     Symb = NULL;
@@ -38,6 +39,8 @@
 
     primary_color = G_malloc(sizeof(RGBA_Color));
     primary_color->a = RGBA_COLOR_OPAQUE;
+    secondary_color = G_malloc(sizeof(RGBA_Color));
+    secondary_color->a = RGBA_COLOR_OPAQUE;
 
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();
@@ -97,9 +100,15 @@
         primary_color->g = colors[i].g;
         primary_color->b = colors[i].b;
 
+        if (bcolor !=NULL) {
+            secondary_color->r = bcolor->r;
+            secondary_color->g = bcolor->g;
+            secondary_color->b = bcolor->b;
+        }
+
         draw_line(ltype, line, Points, Cats, chcat, size, default_width,
                   Clist, Symb, primary_color, &n_points, &n_lines,
-                  &n_centroids, &n_boundaries, &n_faces);
+                  &n_centroids, &n_boundaries, &n_faces, secondary_color);
     }
 
     if (n_points > 0)
@@ -134,7 +143,7 @@
               const struct cat_list *Clist, SYMBOL * Symb,
               RGBA_Color * primary_color,
               int *n_points, int *n_lines, int *n_centroids,
-              int *n_boundaries, int *n_faces)
+              int *n_boundaries, int *n_faces, RGBA_Color *secondary_color)
 {
     double var_size, rotation;
     int i;
@@ -194,7 +203,7 @@
             return 0;
 
         D_line_width(default_width);
-        D_symbol(Symb, x0, y0, primary_color, primary_color);
+        D_symbol2(Symb, x0, y0, primary_color, secondary_color);
     }
     else {
         /* Plot the lines */

Modified: grass/trunk/display/d.vect.thematic/local_proto.h
===================================================================
--- grass/trunk/display/d.vect.thematic/local_proto.h	2016-08-18 14:34:33 UTC (rev 69153)
+++ grass/trunk/display/d.vect.thematic/local_proto.h	2016-08-18 15:12:39 UTC (rev 69154)
@@ -21,10 +21,11 @@
            int chcat, double size, int default_width,
               const struct cat_list *Clist, SYMBOL *Symb,
               RGBA_Color *primary_color, int *n_points, int *n_lines,
-              int *n_centroids, int *n_boundaries, int *n_faces);
+              int *n_centroids, int *n_boundaries, int *n_faces,
+              RGBA_Color *secondary_color);
 
 int display_lines(struct Map_info *, struct cat_list *, int,
           const char *, double, int, dbCatValArray *, double *, int,
-          const struct color_rgb *);
+          const struct color_rgb *, const struct color_rgb *);
 
 

Modified: grass/trunk/display/d.vect.thematic/main.c
===================================================================
--- grass/trunk/display/d.vect.thematic/main.c	2016-08-18 14:34:33 UTC (rev 69153)
+++ grass/trunk/display/d.vect.thematic/main.c	2016-08-18 15:12:39 UTC (rev 69154)
@@ -432,7 +432,8 @@
         else if ((Vect_get_num_primitives(&Map, GV_POINT) > 0) ||
                  (Vect_get_num_primitives(&Map, GV_LINE) > 0)){
             stat = display_lines(&Map, Clist, chcat, icon_opt->answer, size,
-                   default_width, &cvarr, breakpoints, nbreaks, colors);
+                   default_width, &cvarr, breakpoints, nbreaks, colors,
+                   has_color ? &bcolor : NULL);
         }
 
 



More information about the grass-commit mailing list